Wiki

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

pass variables or content block from view file to layout file

Created 3 years ago by yiqing95How-tos0 comments – viewed 19,586 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,212 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.

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,121 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.

Simple example for language translation

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

How to use Smarty renderer in Yii

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

Yii2: Configuring different sessions for backend and frontend in Yii Advanced Application Template

Created about a year ago by hrnairHow-tos2 comments – viewed 19,098 times – ( +6 ) – version 2.0
This is as an extension of this wiki by Kartik V which shows to make different enableAutoLogin cookies for frontend and backend.

Popup AJAX DialogBox without any extension

Created 3 years ago by Kostas Apazidis (KonApaz)How-tos4 comments – viewed 18,801 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.

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

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

Cheat Sheet: Displaying Name instead of Numbers and Displaying Alphanumeric instead of numeric values

Created 3 years ago by skwordenHow-tos4 comments – viewed 18,199 times – ( +4 / -1 ) – version 1.1
I keep a reference to some simple but painful task if you forget a common or something. I am new to Yii and this took awhile for me to figure out. Everything I read said do this or do that and not a single one worked for me. However, the following did.

Twitter Bootstrap style Breadcrumbs

Created 3 years ago by junaidatariHow-tos0 comments – viewed 17,800 times – ( +5 / -1 ) – version 1.1
1: Create breadcrumb in your view file.