Yii 1.1: formatbehavior

FormatBehavior and AutoTimeStamp
2 followers

A component to manage the formatting in the input / output data as a CActiveRecordBehavior. Opportunity makes the job of AutoTimeStamp.

Documentation

Requirements

  • Yii 1.1 or above

Installation

  • Extract the release file under protected/components

Usage

See the following code example:

public function behaviors() {
        return array(
                'FormatBehaviorAutoTimeStamp' => array(
                        'class' => 'application.components.FormatBehavior',
                        'typeFormater' => 'dateTime',
                        'useTimeStamp'=>true,
                        'autoTimeStamp'=>true,
                ),
                'FormatBehaviorMoney' => array(
                        'class' => 'application.components.FormatBehavior',
                        'typeFormater' => 'money',
                        'collumns'=>array('price', 'freight')
                ),
                'FormatBehaviorData' => array(
                        'class' => 'application.components.FormatBehavior',
                        'typeFormater' => 'datetime',
                        'collumns'=>array('delivery')
                ),
        );
    }

Change Log

July 19, 2010

  • Initial release.

Total 1 comment

#2306 report it
Trejder at 2010/12/10 05:49am
typeFormater => datetime

What about 'typeFormater' => 'datetime' and nationalization? Does it supports different date format rules in different languages or is coded to support English / American date formats only?

Leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: Rafael Garcia
  • Category: Others
  • Votes: No votes yet
  • Downloaded: 406 times
  • Created on: Jul 19, 2010
  • Last updated: never