Showing 121-140 of 652 items.

Display a nice exception message on ajax requests

Created 15 years ago by Maurizio Domba Cerin Maurizio Domba Cerin, updated 15 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: 53 325 times
Version: 1.1
Category: Tips

Customizing Yii's formatting rules (extending CFormatter)

Created 15 years ago by Haensel Haensel, updated 15 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 792 times
Version: 1.1
Category: Tips

Avoiding duplicate script download when using CActiveForm on Ajax calls

Created 15 years ago by Antonio Ramirez Antonio Ramirez, updated 15 years ago by Maurizio Domba Cerin Maurizio Domba Cerin. 2 comments

The only thing required is simple, we just need to create a view that will be partially rendered by a call to a controller (using renderPartial) and make sure that we process output -setting to true the parameter on the function. Everything will work as expected but...

11 1
9
Viewed: 31 075 times
Version: 1.1
Category: Tutorials

Multilanguage web site controlling by get request and database allowed languages

Created 15 years ago by Igor Ivanovic Igor Ivanovic, updated 15 years ago by rei rei. 2 comments

First, you have to have create database table for default language and allowed languages.

CREATE TABLE IF NOT EXISTS `tbl_languages` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `name` varchar(20) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `lang` varchar(2) CHARACTER SET utf8 COLLATE utf8_unicode_ci NOT NULL,
  `flagpath` varchar(40) CHARACTER SET utf8 COLLATE utf8_unicode_...
5 0
12
Viewed: 35 044 times
Version: 1.1
Category: Tutorials

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: 82 245 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: 21 224 times
Version: 1.1
Category: Tips