Wiki

Articles in category "tutorials", sorted by viewsX
Displaying 71-80 of 230 result(s).

How to log changes of ActiveRecords?

Created 5 years ago by pfthTutorials7 comments – viewed 31,288 times – ( +35 / -2 ) – version 1.1
A simple and effective way to keep track what your users are doing within your application is to log their activities related to database modifications. You can log whenever a record was inserted, changed or deleted, and also when and by which user this was done. For a CActiveRecord Model you could use a behavior for this purpose. This way you will be able to add log functionality to ActiveRecords very easily.
tags: Logging

Adding login form to each page

Created 4 years ago by pestaaTutorials5 comments – viewed 30,930 times – ( +3 / -2 ) – version 1.1
After adding proper form to the main layout, like:

Working with radiobutton list

Created 2 years ago by vibhaJadwaniTutorials2 comments – viewed 29,797 times – ( +9 ) – version 1.1
This is a tutorial to work with radioButtonList which will handle enum datatype. Form design and validation both are detailed here.

Multiple Databases and Multiple Domains

Created 3 years ago by got 2 doodleTutorials2 comments – viewed 29,245 times – ( +14 / -2 ) – version 1.1
Add these lines in /config/main.php
tags: database

Manage application configuration in different modes

Created 5 years ago by qiangTutorials5 comments – viewed 28,932 times – ( +15 ) – version 1.1
Info: This tutorial references the idea presented in Jonah's excellent blog article.

Simplified meta tags

Created 4 years ago by Y!!Tutorials4 comments – viewed 28,709 times – ( +13 ) – version 1.1
If we want to set meta tags on a per page (controller-action) basis, we may use the clientScript application component.

Custom Number Formatting or Decimal Separators and i18n

Created about a year ago by c@cbaTutorials8 comments – viewed 28,346 times – ( +6 ) – version 1.1
By default, the decimal separator in php (also in mysql) is a dot (.). So when we work with floats in Yii (in calculations, validation, sql statements etc.), the decimal separator has to be a dot. If we want to use for example a comma (,) as the decimal separator, that is if we want to display numbers and enable users to enter numbers with a comma before the decimals, we have to...

Exporting CGridView results to CSV file

Created 2 years ago by RusAlexTutorials9 comments – viewed 28,068 times – ( +6 / -3 ) – version 1.1
A few days ago, i worked for CGridView exporting functional for my client. He asked me to create a simple exporting to a CSV file a CGridView search results.
tags: cgridview, export, csv

Simple access control

Created 2 years ago by szfjozsefTutorials4 comments – viewed 28,050 times – ( +4 / -8 ) – version 1.1
For those who feel, the Controller->accessRules() or RBAC (Role-Based Access Control) is too complicated or doesn't want the username(s) to be hard-coded in accessRules(), here is a very simple, easy-to-implement solution.

To configure Yii path in Windows platform

Created 3 years ago by CodaTutorials2 comments – viewed 27,855 times – ( +3 / -6 ) – version 1.1
I can see many questions regarding configuring the path using Windows OS. I could hardly get the right information about it. The cook book has defined for Linux. So I would like to share my idea on it. To configure the Yii path using Windows OS,