Wiki

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

Preventing CJuiTabs from hiding drop-down CMenu items

Created 3 years ago by Steve FriedlTips1 comment – viewed 8,194 times – ( +4 ) – version 1.1
Almost all Yii applications use CMenu at the top of each page to show options available to the user, and many include drop-down components to allow more fine-grained selection.

Como trasponer una lista creada con CHtml::checkBoxList

Created 2 years ago by rdjteamTips3 comments – viewed 8,185 times – ( +2 ) – version 1.1
En ciertas ocasiones tenemos que lidiar con el tema de colocar una lista de checkboxes para hacer una seleccion especifica como es el caso de los dias de la semana para un calendario, para esta labor tenemos el comando CHtml::checkBoxList(), revisando un poco el funcionamiento de este temos los siguientes parametros:

How to catch and log MySQL deadlock errors

Created 2 years ago by sebTips1 comment – viewed 8,025 times – ( +4 ) – version 1.1
This method allows to log InnoDB monitor output when deadlock error occured. This way we will have much more useful data to find and fix deadlock.
tags: database

Using CListView to display items next to each other (in columns)

Created about a year ago by thyseusTips3 comments – viewed 7,906 times – ( +9 )
When using CListView to display multiple views next to each other, we can use the $index variable inside the viewFile to achieve this. As far as i know there is no extension or out-of-the-box functionality for this, so we need to apply a little hack:

Debugging CActiveRecord failed save() attempts

Created about a year ago by BoazTips0 comments – viewed 7,885 times – ( +4 ) – version 1.1
When you're filling up a form of a CActiveRecord (using CActiveForm for example), usually you'll construct your code so that in case of validation error you'll get back the form with the error displayed back to you, typically when CActiveForm.errorSummary() is used. This is how its done by Gii.

Adding a link to a CDataColumn

Created about a year ago by le_topTips6 comments – viewed 7,865 times – ( +3 ) – version 1.1
Backoffice Grid Views often list information like Posts for a blog while showing at the same time linked information like the User who wrote that post. For more efficiency, it is appropriate that the User is displayed as a link to the User detail page.

Understanding series articles

Created 2 years ago by GOshaTips0 comments – viewed 7,698 times – ( +16 ) – version 1.1
Here are all wiki articles from "Understanding" series by Yii wiki contributors:

Functional tests independing from your urlManager settings

Created 3 years ago by RusAlexTips1 comment – viewed 7,239 times – version 1.1
If you are testing your app and use urlManager in your config, sometimes you will find a problem: you want to test your site independing from urlManager settings. in that way you need to extend your WebTestCase class by this method:

PHPStorm & NetBeans autocomplete problem

Created about a year ago by StagelineTips1 comment – viewed 7,237 times – ( +21 ) – version 1.1
The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.

An important tip when you are using CArrayDataProvider.

Created about a year ago by sirin kTips0 comments – viewed 7,053 times – ( +8 / -1 ) – version 1.1
Yii ‘s CArrayDataProvider is very helpful to display model relation data's directly on it.But it is truely a confusing one because by default it will assume a table field named “id” as primary key for its pagination purpose and what if you dont have field named “id” as primary key on your table? so its truely confusing and if you tried to display without an “id” field on ur table you will get an error like “yourmodel.id is not defined”.