Yii 1.1: banglasupportmodule

For Bangla Input and Bangla Output on DB
3 followers

In DB int and float dataTypes are no supported bangla, so users has to input other info in bangla, but in case of those fields whiches are from dataTypes int and float, they have to put them with English. With this module, the user can also input the int and float dataTypes data in Bangla.

(Bangla is my mother language. I love it. )

Requirements

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

BackThrough

...You Must Disable ajaxvalidation for associative _form.php

Usage

...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.TanimBangla.*',
    ),

This module has four functions,

  1. inputBanglaInteger($model)
  2. outputBanglaInteger($data)
  3. filterBanglaInteger($model)
  4. forUpdateBanglaInteger($model)

1. inputBanglaInteger($model)

this function is used for translating Bangla 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'];
 
            TanimBanglaModule::inputBanglaInteger($model);

2. outputBanglaInteger($data)

this function is used for translate English data (int and float) from DB to Bangla 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' => 'TanimBanglaModule::outputBanglaInteger($data->id);',                
 
            ),
 
            array(
                'class' => 'CButtonColumn',
            ),
        ),
    ));

3. filterBanglaInteger($model)

this function is used to support user to search data with Bangla 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;
TanimBanglaModule::filterBanglaInteger($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){
  TanimBanglaModule::forUpdateBanglaInteger($model);
    }

Total 4 comments

#9338 report it
tanimgt at 2012/08/04 02:58pm
I didnt understand

abhishek2890 , bro what you saying , i cannt understand it. can you re post your problem or suggestion please ?

#9224 report it
Abhishek Shah at 2012/07/30 06:44am
models &m components folder is empty

u have import it,but not in attachment,is it necessary?

#6398 report it
masum at 2012/01/07 12:47am
Good job

We appreciate your effort .... keep it live

#6397 report it
tanimgt at 2012/01/06 11:50pm
Need some reply

there is a say, "Something is Better then Nothing"

Leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: Other Open Source License
  • Developed by: tanimgt
  • Category: User Interface
  • Votes: +6
  • Downloaded: 228 times
  • Created on: Jan 6, 2012
  • Last updated: Jan 14, 2012
  • Tags: module