betadog / yii1-components
Some components for Yii1
1.0.0
2020-04-19 08:05 UTC
Requires
- php: >=7.2
- yiisoft/yii: 1.*
This package is auto-updated.
Last update: 2024-12-25 08:22:58 UTC
README
This package provide some behaviors:
MiniTrace
- allow get minitrace anywere in applicationOrderingValueBehavior
- allows automatically assign a value to ordering column
MiniTrace.php
Allow writes echo Yii::app()->miniTrace();
Just add follow code into ./protected/config/main.php
'behaviors' => [
'miniTrace' => [
'class' => 'application.components.behaviors.MiniTraceBehavior',
],
],
OrderingValue.php
Class allow u to automatically set value for ordering column for new elements. Just add behavior
to your CActiveRecord
model and define column name:
public function behaviors()
{
return [
'orderingAttribute' => [
'class' => 'application.components.behaviors.OrderingValueBehavior',
'columnName' => 'ordering', // order column name
'position' => OrderingValue::POSITION_END // position for new element
],
];
}