Yii 1.1: abhishek2890

For Gujarati Digits Input and Gujarati Output on DB
1 follower

...overview of the extension...


...requirements of using this extension (e.g. Yii 1.1 or above)...


...how to use this extension...

how to use this module...

...to use this module, extract it to your protected/modules/ folder...

and import it to your main.php config file as,

'import' => array( 'application.modules.Gujarati.*', ),

This module has four functions,


1. inputGujaratiInteger($model)

this function is used for translating Gujarati input (int and float) to English and takes the associative model as parameter.

put this function in your controller's create and update actions, after the line,

if (isset($_POST['YourModel'])) { $model->attributes = $_POST['YourModel']; like if (isset($_POST['YourModel'])) { $model->attributes = $_POST['YourModel'];


2. outputGujaratiInteger($data)

this function is used for translate English data (int and float) from DB to Gujarati for display and takes a model->value as parameter.

add this function in your CGridView columns in your application's views/admin.php file as,

$this->widget('zii.widgets.grid.CGridView', array( 'id' => 'your-model-grid', 'dataProvider' => $model->search(), 'filter' => $model, 'columns' => array( array( 'name' => 'id', 'type' => 'raw', 'value' => 'GujaratiModule::outputGujaratiInteger($data->id);',
), array( 'class' => 'CButtonColumn', ), ), ));

3. filterGujaratiInteger($model)

this function is used to support user to search data with Gujrati in the search fields in CGridView and takes the associative model as parameter.

put this function in your model's search(), after

$criteria = new CDbCriteria;


$criteria=new CDbCriteria; GujaratiModule::filterGujaratiInteger($this);

4. forUpdateBanglaInteger($model)

this function is used for display data from DB in Bangla in associative fields when update a specific row of DB.

put this function at the top of your view/_form.php file, like,

if(!$model->isNewRecord){ GujaratiModule::forUpdateGujaratiInteger($model); }



Be the first person to leave a comment

Please to leave your comment.

Create extension