Wiki

Articles in category "tips", sorted by commentsX
Displaying 31-40 of 98 result(s).

Directory independent extensions

Created 2 years ago by GOshaTips3 comments – viewed 6,043 times – ( +15 / -1 )
Many people want to use downloaded extensions in their own way. As for me most of the extensions require me to correct Yii::import() instructions inside their source code. All these extensions are directory dependent. To avoid the situation described above, I suggest to implement pseudo-anonymous aliases:

Using sub query for doubletts

Created 9 months ago by mbTips3 comments – viewed 3,762 times – ( +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.

Auto TDD - How to auto-run PHPUnit

Created 2 years ago by imeheszTips3 comments – viewed 9,127 times – ( +3 )
If you are lucky enough and have the privilege to develop on a Linux based environment, this little tip might boost-up your TDD process (at least the Unit Testing part). Please note, that this should work just fine with Apple computers also, but not tested!
tags: PHPUnit, testing, TDD

Yii shorten common functions with OOP style

Created 6 months ago by pdtkameTips3 comments – viewed 3,705 times – ( +9 / -14 )
This article will show how you can use Yii common functions as shorten OOP function. These functions will help you work with Yii common functions is easier as OOP style.

Adding 'disabled' to CCheckBoxColumn and support for yiigridview.js

Created 6 months ago by Xgamer99Tips3 comments – viewed 4,002 times – ( +1 )
I recently had to have a checkbox column in my grid view that supported the 'disabled' attribute. This was easy enough to do by extending the CCheckBoxColumn. However, I also wanted the checkbox to be selected when clicking on the table's row (supported via CGridView's selectableRows option). I discovered I had to tweak yiigridview.js so that it would not select disabled rows when clicking on it or on the 'select all' checkbox.

Fixing extensions without modifying their code

Created 2 months ago by schmunkTips3 comments – viewed 2,161 times – ( +5 )
If you're working a lot with extensions you often stumble upon problems, when you want to include them into your custom web application, like hardcoded or absolute path aliases or classes extended from core application components, which implement addiditonal features.

Adding a link to a CDataColumn

Created 2 months ago by le_topTips3 comments – viewed 2,673 times – ( +2 )
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.

How to ensure unicity to url

Created about a year ago by zaccariaTips3 comments – viewed 8,186 times – ( +14 )
Many time for SEO porpouses is important that each page will have a unique address.
tags: SEO, unique, URL

Como trasponer una lista creada con CHtml::checkBoxList

Created about a year ago by rdjteamTips3 comments – viewed 4,993 times – ( +2 )
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:

Use application on production/development environment without making changes

Created about a year ago by ifdatticTips2 comments – viewed 16,053 times – ( +8 / -1 )
I like programing on my localhost, however it really bugged me to make changes to index.php & config files on my production server. After combining all available wiki articles on this topic and some trial and error this is what I use for my applications so I could just upload it to production server and it will work without any changes.