Wiki

Sorted by viewsX
Displaying 371-380 of 785 result(s).

pass variables or content block from view file to layout file

Created 4 years ago by yiqing95How-tos0 comments – viewed 20,439 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.

Using cache in CActiveDataProvider

Created 5 years ago by StammTips7 comments – viewed 20,375 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.

How to hide index.php on Microsoft Windows Server with IIS7

Created 4 years ago by GiulianoHow-tos2 comments – viewed 20,258 times – ( +10 ) – version 1.1
I've seen lot of people struggling in finding a way to hide the script name when installing their Yii Application. In an Apache environment everything is well documented in this wiki article, but for those who are running their app on a Windows Server machine there are no hints.

Simple example for language translation

Created 2 years ago by RKAHow-tos2 comments – viewed 20,215 times – ( +1 ) – version 1.1
Language translation is a common requirement in multi lingual sites. In Yii, we can translate using message and view translation.
tags: yii, i18n

Yii 2.0: Write & use a custom Component in Yii2.0 (Advanced Template)

Created 2 years ago by Deepak PradhanHow-tos1 comment – viewed 20,189 times – version 2.0
This is an extension to Yii 2.0: Write & use a custom Component in Yii2.0 for Advanced Template

i18n All-in-one format and timezone conversions for date, time, timestamp and datetime.

Created 3 years ago by Gerhard LiebenbergHow-tos3 comments – viewed 20,125 times – ( +8 / -1 ) – version 1.1
Countries sometimes change their laws pertaining to time zones and daylight saving times. This means that GMT+2 can be a different time this August compared to last August! However, by using php's DateTime class (instead of timestamps), we can do both "format" and "time zone" conversions on a single DateTime object (only 2 lines of code) for date, time, timestamp and datetime types - while php takes care of nightmares such as current and historical time zones and daylight saving times.

"safe" and "unsafe" Model validators (massive assignments)

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos4 comments – viewed 20,119 times – ( +4 / -6 ) – version 1.1
Ok, it is a little bit difficult to full understanding the unsafe validator.

First Yii App: CTabView

Created 7 years ago by meanpenguinTutorials1 comment – viewed 20,071 times – ( -2 ) – version 1.1
Once you are completed with the "Creating First Yii Application", the following can be done.

Load the Yii-Bootstrap Extension on Specific Actions

Created 4 years ago by chuntleyHow-tos5 comments – viewed 20,026 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

Rendering Views and Updating them with Ajax

Created 3 years ago by Manish GuptaTips4 comments – viewed 19,897 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.