Showing 61-80 of 120 items.

Use application on production/development environment without making changes

Created 14 years ago by ifdattic ifdattic, updated 14 years ago by ifdattic ifdattic. 3 comments

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.

8 1
11
Viewed: 81 400 times
Version: 1.1
Category: Tips

1:n relations sometimes require CDbCriteria.together

Created 14 years ago by fsb fsb, updated 12 years ago by fsb fsb. 5 comments

There are situations in which Active Record will generate nonsense queries from what a nieve Yii user might think is reasonable code. One such situation is a CActiveDataProvider using CDbCriteria to get data from parent and 1:n child table with a condition on the child table.

15 0
12
Viewed: 55 544 times
Version: 1.1
Category: Tips

Yii Security-extended guide

Created 14 years ago by bingjie2680 bingjie2680, updated 14 years ago by bingjie2680 bingjie2680. 11 comments

This article is called extended guide is because there is already a security guide in the Yii tutorial security section. but that guide is not complete in the sense that it does not rise the developers' attention to some other commonly happening attacks: SQL injection and magic URL, which can be major vulnerabilities in you...

6 6
12
Viewed: 37 128 times
Version: 1.1
Category: Tips

Como trasponer una lista creada con CHtml::checkBoxList

Created 14 years ago by rdjteam rdjteam, updated 14 years ago by rdjteam rdjteam. 3 comments

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:

2 0
4
Viewed: 20 907 times
Version: 1.1
Category: Tips

Special $variables in CGridView and CListView

Created 14 years ago by Steve Friedl Steve Friedl, updated 14 years ago by Steve Friedl Steve Friedl. 11 comments

The popular [CListView] and [CGridView] widgets each take a data provider and iterate over each data object produced, calling the user's code to render each row one at a time, and most are familiar with the use of the $data variable to represent the current model object or array.

23 1
33
Viewed: 81 703 times
Version: 1.1
Category: Tips

Customizing Yii's formatting rules (extending CFormatter)

Created 14 years ago by Haensel Haensel, updated 14 years ago by Haensel Haensel. 0 comments

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)...

12 0
6
Viewed: 25 495 times
Version: 1.1
Category: Tips

Display a nice exception message on ajax requests

Created 14 years ago by Maurizio Domba Cerin Maurizio Domba Cerin, updated 14 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 3 comments

in Yii versions previous to 1.1.9 exceptions was handled differently during ajax request and displayed by CApplication::displayException(). This way the exception message displayed on ajax requests could not be customized.
The message for the CGridView delete request with YII_DEBUG set to true l...

12 0
19
Viewed: 52 654 times
Version: 1.1
Category: Tips