Wiki

Articles in category "how-tos", sorted by viewsX
Displaying 51-60 of 355 result(s).

How to validate CSRF token with session

Created 5 years ago by yangmlsHow-tos2 comments – viewed 55,614 times – ( +23 / -1 ) – version 1.1
First of all, You must change component config to enable the default Yii CSRF validation.
tags: CSRF, session

[Guide] How to actually separate Frontend (User) and Backend (Admin) on Yii2 Advanced

Created 2 years ago by Wade ShulerHow-tos2 comments – viewed 55,032 times – ( +17 / -2 ) – version 2.0
I am writing this guide because I struggled to find a resource that included ALL of the necessary steps to completely separate the frontend from the backend. After reading guides like Configuring different sessions for backend and frontend in yii-advanced-app and yii2 configuring different sessions for backend and frontend in yii advanced application template, there are still steps missing. It is funny how the 2nd one says it is an extension of the first one's article. So I guess, my wiki guide here is yet a 3rd and more complete extension of both of them. I also found a few StackOverflow questions and blog posts regarding this topic. None of them fully worked, and must be missing some magic sauce!

How to avoid multiple Ajax Request

Created 6 years ago by nickcvHow-tos26 comments – viewed 54,908 times – ( +25 / -3 ) – version 1.1
CHtml::ajaxLink(), CHtml::ajaxSubmitButton() and similar methods are great, but if they are located inside a portion of the page that is already loaded via ajax something bad will happen, something you may even not notice if you are not using tools like firebugs: the sent ajax requests will multiply themselves.

How to use GridView with AJAX

Created 3 years ago by Antonio RamirezHow-tos6 comments – viewed 54,779 times – ( +14 / -1 ) – version 2.0
With the adoption of PJax on Yii2 things  have change quite a bit with GridView when it comes to work with them in AJAX mode. It will probably be confusing at the beginning, but then you will soon realize how powerful the new approach is.
tags: yii2, pjax, widget

Create custom button button with AJAX function in CGridView

Created 4 years ago by nkdHow-tos2 comments – viewed 54,544 times – ( +19 / -1 ) – version 1.1
CButtonColumn in CGridView can be customised to include user built buttons. To learn a great deal about including custom buttons, read this excellent wiki. This tutorial will show how to call an action from one custom button using AJAX instead of regular GET calls.

Sort and filter a custom or composite CGridView column - that may even contain data from different tables.

Created 3 years ago by Gerhard LiebenbergHow-tos2 comments – viewed 53,099 times – ( +6 / -2 ) – version 1.1
I have a table (account) which contains "General Ledger" accounts. Each account has its own account_description - such as 'inventory', 'sales', etc.

How to implement cron in Yii 2

Created 3 years ago by hemcHow-tos10 comments – viewed 52,612 times – ( +10 / -1 ) – version 2.0
In advance template there is already a file yii. And there is no need to run it as php, it is Linux script.
tags: cron, yii2, console

Upload image and content using AJAX and Store it in different table

Created 3 years ago by Selvakumar KaliyappanHow-tos1 comment – viewed 51,753 times – ( +3 / -1 ) – version 1.1
We all know how to upload the content and images at the same time with refreshing the page. And uploading the images using Ajax we have faced some issues, here i have fixed the issues and both content and photos are uploaded using Ajax. And both content and images are stored in the different tables

Using CJuiDatePicker for CGridView filter

Created 5 years ago by softarkHow-tos21 comments – viewed 51,620 times – ( +27 / -1 ) – version 1.1
We can use a CJuiDatePicker for a CGridView inline filter.

Install, update and use Yii with WAMP server

Created 4 years ago by mrsHow-tos5 comments – viewed 51,406 times – ( +5 / -2 ) – version 1.1
Here I am describing how you can install and update Yii in WAMP sever.