Wiki

Articles in category "tips", sorted by viewsX
Displaying 81-90 of 154 result(s).

PHPStorm & NetBeans autocomplete problem

Created 4 years ago by StagelineTips3 comments – viewed 13,725 times – ( +24 / -1 ) – version 1.1
The problem: If you type Yii::app()->user<ctrl+space> code completion didn't work. This solve it.

How to change GridView delete confirmation message for specific controllers only?

Created about a year ago by AlaFalakiTips1 comment – viewed 13,707 times – ( +2 / -1 ) – version 2.0
Hello, If you want to give extra attention for some specific delete actions and you don't want to override whole yii.confirm JS method here is what you can do: (I've only put the ActionColumn part of the GridView here to just give you the idea)

Using sub query for doubletts

Created 4 years ago by mbTips3 comments – viewed 13,548 times – ( +2 / -1 ) – version 1.1
find doubletts by db fields. in this example i will check doublets for 3 tabelfields (col1,col2,col3). so i will get a subquery with the condition, select and grouping of the tablefields. the having with COUNT() > 1 means: find all records more then one result.

URL component access functions

Created 6 years ago by Steve FriedlTips1 comment – viewed 13,309 times – ( +28 / -1 ) – version 1.1
Many applications wish to obtain parts of the URL for the current page (the hostname, the query string, etc.), and the CHttpRequest class wraps various $_SERVER variables to break down the URL into its constituent parts.
tags: URL, request

Como trasponer una lista creada con CHtml::checkBoxList

Created 5 years ago by rdjteamTips3 comments – viewed 13,038 times – ( +2 / -1 ) – 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:

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

Created 4 years ago by thyseusTips4 comments – viewed 13,027 times – ( +11 / -1 )
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:

How to catch and log MySQL deadlock errors

Created 5 years ago by sebTips1 comment – viewed 12,806 times – ( +4 / -1 ) – 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

An important tip when you are using CArrayDataProvider.

Created 4 years ago by sirin kTips0 comments – viewed 12,650 times – ( +8 / -2 ) – 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”.

ChromePHP for Yii

Created 6 years ago by imeheszTips0 comments – viewed 12,587 times – ( +3 / -3 ) – version 1.1
ChromePHP is a console logging extension for Google Chrome.

CGridView customized CCheckBoxColumn

Created 3 years ago by chandranTips2 comments – viewed 12,577 times – ( +5 / -1 ) – version 1.1
Hi friends,