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
Notice
Sorry this extension removed a moment from original source (github).
mdmunir.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.