64 lines
1.6 KiB
PHP
64 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace common\modelsgii;
|
|
|
|
use Yii;
|
|
|
|
/**
|
|
* This is the model class for table "{{%menu}}".
|
|
*
|
|
* @property string $menuUrl 菜单地址
|
|
* @property string $menuName 菜单名称
|
|
* @property string $parentPath 上级路由
|
|
* @property string $routeName 路由name
|
|
* @property string $redirect 是否隐藏
|
|
* @property string|null $icon 菜单图标
|
|
* @property int|null $sort
|
|
* @property int|null $cacheable 是否缓存
|
|
* @property int|null $hidden 是否隐藏
|
|
* @property int|null $affix 是否固定标题栏
|
|
*/
|
|
class Menu extends \common\core\BaseActiveRecord
|
|
{
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public static function tableName()
|
|
{
|
|
return '{{%menu}}';
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function rules()
|
|
{
|
|
return [
|
|
[['menuUrl'], 'required'],
|
|
[['sort', 'cacheable', 'hidden', 'affix'], 'integer'],
|
|
[['menuUrl', 'menuName', 'parentPath', 'routeName', 'icon'], 'string', 'max' => 50],
|
|
[['redirect'], 'string', 'max' => 255],
|
|
[['menuUrl'], 'unique'],
|
|
];
|
|
}
|
|
|
|
/**
|
|
* {@inheritdoc}
|
|
*/
|
|
public function attributeLabels()
|
|
{
|
|
return [
|
|
'menuUrl' => '菜单地址',
|
|
'menuName' => '菜单名称',
|
|
'parentPath' => '上级路由',
|
|
'routeName' => '路由name',
|
|
'redirect' => '是否隐藏',
|
|
'icon' => '菜单图标',
|
|
'sort' => 'Sort',
|
|
'cacheable' => '是否缓存',
|
|
'hidden' => '是否隐藏',
|
|
'affix' => '是否固定标题栏',
|
|
];
|
|
}
|
|
}
|