betadog / yii1-components
Some components for Yii1
Installs: 209
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
pkg:composer/betadog/yii1-components
Requires
- php: >=7.2
- yiisoft/yii: 1.*
This package is auto-updated.
Last update: 2025-10-25 10:10:18 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
],
];
}