yii-autonumber Auto Number Extension for Yii 1

  1. Requirements
  2. Installation
  3. Usage
  4. Resources

Auto Number Extension for Yii 1

Requirements

Yii 1.1

Installation

Download extension from here and extract to extensions/autonumber.

Usage

Prepare required table by execute yii migrate. ~~~ yii migrate --migrationPath=ext.autonumber ~~~ Once the extension is installed, simply modify your active record class:

public function behavior()
{
    return array(
        array(
            'class' => 'ext.autonumber.MdmAutonumberBehavior',
            'attribute' => 'sales_num', // required
            'group' => 'sales', // required, unique
            'value' => 'SA-'.date('Y-m-d').'?' , // format auto number. '?' will be replaced with generated number
            'digit' => 4 // optional, default to null. 
        ),
        ...
    );
}

Resources

Fork me on github

0 0
3 followers
0 downloads
Yii Version: 1.1
License: BSD-2-Clause
Category: Database
Developed by: Misbahul D Munir
Created on: May 28, 2014
Last updated: 3 years ago

Related Extensions