abhishek2890 For Gujarati Digits Input and Gujarati Output on DB

  1. Requirements
  2. Usage
  3. 1. inputGujaratiInteger($model)
  4. 2. outputGujaratiInteger($data)
  5. 3. filterGujaratiInteger($model)
  6. 4. forUpdateBanglaInteger($model)
  7. Resources

...overview of the extension...

Requirements

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

Usage

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

inputGujaratiInteger($model)
outputGujaratiInteger($data)
filterGujaratiInteger($model)
forUpdateGujaratiInteger($model)

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'];

        GujaratiModule::inputGujaratiInteger($model);

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;

like,

$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);

}

Resources

http://www.yiiframework.com/extension/banglasupportmodule

0 1
1 follower
223 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Database
Tags:
Developed by: Abhishek Shah
Created on: Aug 3, 2012
Last updated: 12 years ago

Downloads

show all