betadog/yii1-components
Composer 安装命令:
composer require betadog/yii1-components
包简介
Some components for Yii1
README 文档
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
],
];
}
to be continued
统计信息
- 总下载量: 209
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: proprietary
- 更新时间: 2020-04-18