banglasupportmodule For Bangla Input and Bangla Output on DB

  1. Requirements
  2. BackThrough
  3. Usage
  4. inputBanglaInteger($model)
  5. 2. outputBanglaInteger($data)
  6. 3. filterBanglaInteger($model)
  7. 4. forUpdateBanglaInteger($model)

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)

  5. 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);
    }
  
5 0
3 followers
282 downloads
Yii Version: 1.1
License: (not set)
Category: User Interface
Tags: module
Developed by: tanimgt
Created on: Jan 7, 2012
Last updated: 12 years ago

Downloads

show all

Related Extensions