Wiki

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

How to validate CSRF token with session

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

Moving project code outside of webroot (plus multiple project support)

Created 5 years ago by Steve FriedlHow-tos8 comments – viewed 47,587 times – ( +22 / -1 ) – version 1.1
Yii's by-default directory organization works well enough, but there are several steps one can take that improve the security and serviceability of the system, especially in the context of multiple Yii projects on the same machine (including multiple versions of the same project).
tags: config, security

Using CJuiDatePicker for CGridView filter

Created 4 years ago by softarkHow-tos21 comments – viewed 47,576 times – ( +27 ) – version 1.1
We can use a CJuiDatePicker for a CGridView inline filter.

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

Created 2 years ago by Gerhard LiebenbergHow-tos2 comments – viewed 47,326 times – ( +6 / -1 ) – 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.

Reliable Alternative For Yii::app()->request->isAjaxRequest AND Adding Data To Ajax Form With JS

Created 4 years ago by ibo_sHow-tos2 comments – viewed 46,239 times – ( +15 / -1 ) – version 1.1
In this How-To I'll show you:

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

Created 2 years ago by SelvakumarHow-tos1 comment – viewed 45,183 times – ( +3 ) – 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

How to show ajax delete status in CGridView like flash messages

Created 5 years ago by hasanaviHow-tos12 comments – viewed 43,386 times – ( +25 ) – version 1.1
I've seen many tickets regarding how to show friendly delete confirmation using CGridView's CButtonColumn in ajax request. If you are using relational database, after producing CRUD functionality when you try to delete a record in ajax mode which has child record it can't be deleted and you can see the ajax loader forever. By this way you can't show the users if a record has been successfully deleted or if there are some problem in flash style (setFlash() / getFlash())

Custom Autocomplete Display and Value Submission

Created 5 years ago by Antonio RamirezHow-tos6 comments – viewed 43,078 times – ( +14 / -1 ) – version 1.1
How many of us has wondered how to create an autocomplete that will display the names of a related models but do require the id of that selected name to be submitted for model creation/update?

Write & use a custom Component in Yii2.0

Created about a year ago by sirin kHow-tos4 comments – viewed 43,023 times – ( +16 ) – version 2.0
This is a simple example in Yii2.0 to understand how you can write a custom component and use it inside your app.(basic template)

Real-time display of server push data using Server-Sent Events (SSE)

Created 4 years ago by bennounaHow-tos16 comments – viewed 42,704 times – ( +12 ) – version 1.1
There are several methods and techniques that come handy in the case you need to call an external resource periodically or if you are waiting for a server push, but I present here an easy and straightforward one using HTML5's Server-Sent Events (SSE).