Wiki

Articles in category "how-tos", sorted by viewsX
Displaying 161-170 of 354 result(s).

Multilanguage and SEO friendly

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

pass variables or content block from view file to layout file

Created 4 years ago by yiqing95How-tos0 comments – viewed 20,151 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 hide index.php on Microsoft Windows Server with IIS7

Created 4 years ago by GiulianoHow-tos2 comments – viewed 19,910 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.

Load the Yii-Bootstrap Extension on Specific Actions

Created 3 years ago by chuntleyHow-tos5 comments – viewed 19,874 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

Simple example for language translation

Created 2 years ago by RKAHow-tos2 comments – viewed 19,865 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

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

Created 3 years ago by Gerhard LiebenbergHow-tos3 comments – viewed 19,803 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 19,561 times – ( +4 / -6 ) – version 1.1
Ok, it is a little bit difficult to full understanding the unsafe validator.

Popup AJAX DialogBox without any extension

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos4 comments – viewed 19,367 times – ( +8 / -1 ) – version 1.1
In this wiki I explain how to show a default popup dialogbox (like Gii does) using an existing module.

How to use Smarty renderer in Yii

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

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

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