Wiki

Articles in category "how-tos", sorted by date (updated)X
Displaying 61-70 of 182 result(s).

Create sitemap.xml file dynamically on root folder with one hit

Updated 6 months ago by kiran sharmaHow-tos1 comment – viewed 3,920 times – ( +4 / -1 )
I had created one controller file which can create sitemap.xml file(which is used for seo, google crawler and many other puropse) dynamically with one run.
tags: SEO, SiteMap, XML

Accessing data in a join table with the related models

Updated 6 months ago by kroweHow-tos7 comments – viewed 36,095 times – ( +18 / -1 )
Sometimes the right place to store application data is in a join table. For example, movie viewers either like or don’t like the movies they watched.

Create your own Validation Rule

Updated 6 months ago by GismoHow-tos8 comments – viewed 62,144 times – ( +58 )
Some times the core validation rules provided by Yii won't satisfy all your needs, so you'll need to create your very own validation rule.

Image resize on the fly

Updated 6 months ago by TpoxaHow-tos3 comments – viewed 5,514 times – ( +4 )
For example have folder with image resources which are public accessible
tags: yii, image-resize

Using International Dates

Updated 6 months ago by nkdHow-tos3 comments – viewed 19,017 times – ( +16 )
I needed British (dd/mm/yyyy) formatted dates throughout my application but found it very difficult to find examples of how to do this - until I found this excellent forum post http://www.yiiframework.com/forum/index.php?/topic/3649-dealing-with-i18n-date-formats/

pass variables or content block from view file to layout file

Updated 6 months ago by Maurizio DombaHow-tos0 comments – viewed 5,176 times – ( +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.

Localized version of CFormatter

Updated 6 months ago by Maurizio DombaHow-tos2 comments – viewed 1,889 times – ( +3 )
The default CFormatter (accessible through Yii::app()->format) is not locale aware, unfortunately. Until it is, here is a quick and easy way to localize it, by extending the default class.

Create custom button button with AJAX function in CGridView

Updated 6 months ago by nkdHow-tos0 comments – viewed 9,577 times – ( +4 )
CButtonColumn in CGridView can be customised to include user built buttons. To learn a great deal about including custom buttons, read this excellent wiki. This tutorial will show how to call an action from one custom button using AJAX instead of regular GET calls.