Inheritance: extends yii\base\Module, implements yii\base\BootstrapInterface
コード例 #1
0
 public function actionGenerate($id)
 {
     $category = Category::findOne($id);
     /** @var StaticUrl $class */
     $class = AdminModule::getInstance()->getCatalog()->staticUrlClass;
     $class::generate($category);
 }
コード例 #2
0
 public function getModel()
 {
     return $this->hasOne(AdminModule::getInstance()->getCatalog()->itemClass, ['item_id' => 'model_id']);
 }
コード例 #3
0
 /**
  * @inheritDoc
  */
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), [['class' => ModelLoaderController::class, 'rules' => [['actions' => ['index', 'generate'], 'ownerAttribute' => 'category', 'modelClass' => Category::class], ['actions' => ['update'], 'ownerAttribute' => 'staticUrl', 'modelClass' => AdminModule::getInstance()->getCatalog()->staticUrlClass]]]]);
 }
コード例 #4
0
ファイル: Catalog.php プロジェクト: nanodesu88/easyii
 /**
  * @param int $categoryId
  * @return Category
  */
 public static function category($categoryId)
 {
     return AdminModule::getInstance()->getCatalog()->categoryFind()->byId($categoryId)->one();
 }
コード例 #5
0
 /**
  * @inheritDoc
  */
 public function getOwner()
 {
     return $this->hasOne(AdminModule::getInstance()->getCatalog()->itemClass, ['id' => 'owner_id']);
 }
コード例 #6
0
 /**
  * @inheritDoc
  */
 public function behaviors()
 {
     return ArrayHelper::merge(parent::behaviors(), ['modelLoader' => ['class' => ModelLoaderController::class, 'rules' => [['actions' => ['category'], 'modelClass' => AdminModule::getInstance()->getCatalog()->categoryClass, 'ownerAttribute' => 'category'], ['actions' => ['attribute', 'add'], 'modelClass' => AttributeRuleRecord::class, 'ownerAttribute' => 'rule'], ['actions' => ['sort', 'update', 'delete'], 'modelClass' => AttributeEnumRecord::class, 'ownerAttribute' => 'enum']]]]);
 }
コード例 #7
0
ファイル: Category.php プロジェクト: nanodesu88/easyii
 /**
  * @return ItemQuery
  */
 public function getItems()
 {
     return $this->hasMany(AdminModule::getInstance()->getCatalog()->itemClass, ['category_id' => 'category_id']);
 }
コード例 #8
0
ファイル: main.php プロジェクト: nanodesu88/easyii
echo Url::to(['/admin/sign/out']);
?>
" class="pull-right"><i class="glyphicon glyphicon-log-out"></i> <?php 
echo Yii::t('easyii', 'Logout');
?>
</a>
                </div>
            </div>
            <div class="main">
                <div class="box sidebar">

                    <?php 
foreach (AdminModule::getInstance()->activeModules as $module) {
    ?>
                        <?php 
    $m = AdminModule::getInstance()->getModule($module->name);
    ?>
                        <?php 
    $subModules = $m->getModules();
    ?>

                        <?php 
    if (count($subModules)) {
        ?>
                            <a href="" class="menu-list <?php 
        echo $moduleName == $module->name ? 'active' : '';
        ?>
">
                                <?php 
        if ($module->icon != '') {
            ?>