Wiki

Sorted by viewsX
Displaying 361-370 of 774 result(s).

CSqlDataProvider in CGridView

Created 2 years ago by Kostas Apazidis (KonApaz)Tutorials8 comments – viewed 19,553 times – ( +8 ) – version 1.1
In this wiki I will show how could use a CSqlDataProvider in CGridView with specific features

Using cache in CActiveDataProvider

Created 4 years ago by StammTips7 comments – viewed 19,453 times – ( +21 ) – version 1.1
First param in CActiveDataProvider could be a string with model name or instance of class. So, you may use CActiveRecord::cache() for cache, but you need set third param to 2, because you should cache 2 queries: counting and get data.

Multilanguage and SEO friendly

Created 2 years ago by InterboyHow-tos1 comment – viewed 19,440 times – ( +5 ) – version 1.1
In your application configuration (protected/config/main.php), set the sourceLanguage parameter to English:

multiple CActiveDataProviders in one CGridView

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos7 comments – viewed 19,385 times – ( +8 / -1 ) – version 1.1
There is a few cases that you want more of one CActiveDataProvider displayed in one CGrideView How to do that?

Load the Yii-Bootstrap Extension on Specific Actions

Created 3 years ago by chuntleyHow-tos5 comments – viewed 19,364 times – ( +10 ) – version 1.1
A big problem I've hit with the Yii-Bootstrap extension is that all AJAX requests are initializing Bootstrap because of preload. This is a huge waste of resources, especially when using AJAX-based file uploaders that split the file into chunks. Large file uploads using that method could be initializing bootstrap hundreds of times.
tags: bootstrap, filter

Debugging CActiveRecord failed save() attempts

Created 3 years ago by BoazTips0 comments – viewed 19,355 times – ( +5 ) – version 1.1
When you're filling up a form of a CActiveRecord (using CActiveForm for example), usually you'll construct your code so that in case of validation error you'll get back the form with the error displayed back to you, typically when CActiveForm.errorSummary() is used. This is how its done by Gii.

pass variables or content block from view file to layout file

Created 3 years ago by yiqing95How-tos0 comments – viewed 19,110 times – ( +2 ) – version 1.1
If you use yiic to generate webApplication there will be a layout folder under the protected/views/, and the Controller class under protected/components which will use by default these layouts files.

How to use Smarty renderer in Yii

Created 5 years ago by dongbetaHow-tos2 comments – viewed 18,942 times – ( +4 ) – version 1.1
At first, create a class named SmartyRenderer under application/components or any directory you want.
tags: smarty, renderer

Rendering Views and Updating them with Ajax

Created 2 years ago by Manish GuptaTips4 comments – viewed 18,935 times – ( +2 )
I wanted to implement a widget that could refresh itself through Ajax without refreshing the whole page. CGridView and CListView are excellent examples of such widgets.

Extension Development (beginner)

Created 2 years ago by sefburhanTutorials2 comments – viewed 18,763 times – ( +34 ) – version 1.1
To extend the functionality of you web application relative to your requirements you are supposed to use existing yii core libraries or use external libraries. There are some steps to ensure security, uniqueness, modularity, performance and to avoid rework in future.