The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.
The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.
This Behaviour helps to view time/date/timestamp/datetime from db to local Date / Time / Date Time format and in local Timezone. And save into db in with db timezone and db format. You only need to include this behaviour in models where need this facility.
To accomplish the task of changing Migration table's name, by default tbl_migration, you need to add the following in your ./protected/config/console.php.
How to add additional information to a user when using BUM extension?
Stores session data in database and transfer data when session is destroy. Uses for check users online, user's last activity and last ip.
Yesterday I've written a module for myself. Just an experiment. When I was feeling satisfied, I've created a repository on github, and pushed my code. My module and yii are on github. So I'll show you a "new" way to start our yii projects.
There are scenarios when you work with DVCS (like [Mercurial]( http://mercurial.selenic.com/) or [Git]( http://git-scm.com/)) and CDbMessageSource. To my experience keeping the development database and production database in sync can be very...
Sometimes text inside a gridview column is just too long. That's why I figured out a way to make the column smaller while still providing the information.
Let's take the example of the above article to display an email button next to a delete button:
Sometimes we need to create our custom exception and show it to the end user through a friendly way . In this article, I'm showing how to do it using CJuidialog.
At first, create a class named SmartyRenderer under application/components or any directory you want.
This behavior will automatically set timestamp fields to the row creation and modification times.
There are several ways to speedup slow unit tests which interact with database:
Yii i18n does not cover decimal format. Some languages like Spanish (I live in Argentina) uses comma ',' instead of dot '.' as decimal separator.
The export to excel function will affected by the final resorted columns in case you use my export grid to excel extends hzlexportgrid too, Since that export extention just depends on the grid columns configs, and that columns been customized by user themselves just now.
The config first required In CApplication constructor
This wiki will explain how to include a javascript library in a widget.
CFormatter is one of Yii's core components and used to format values displayed in widgets like CGridView or CDetailView. All classic formats like numbers, text, urls or datetime are supported but you may have to use a formatting rule that isn't built in. Let's say we want to display arrays of strings (like tags associated with a product model)...
If you want to edit data directly in the gridview in a 'dropdownlist' style, then you could use the 'type' => 'select' option of TbEditableColumn (YiiBooster) or EditableColumn (x-editable for Yii). This wiki shows how to get data from the db for the 'dropdownlist', by converting AR model data into an array that is passed in json format.