public function actionGenerate($id) { $category = Category::findOne($id); /** @var StaticUrl $class */ $class = AdminModule::getInstance()->getCatalog()->staticUrlClass; $class::generate($category); }
public function getModel() { return $this->hasOne(AdminModule::getInstance()->getCatalog()->itemClass, ['item_id' => 'model_id']); }
/** * @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]]]]); }
/** * @param int $categoryId * @return Category */ public static function category($categoryId) { return AdminModule::getInstance()->getCatalog()->categoryFind()->byId($categoryId)->one(); }
/** * @inheritDoc */ public function getOwner() { return $this->hasOne(AdminModule::getInstance()->getCatalog()->itemClass, ['id' => 'owner_id']); }
/** * @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']]]]); }
/** * @return ItemQuery */ public function getItems() { return $this->hasMany(AdminModule::getInstance()->getCatalog()->itemClass, ['category_id' => 'category_id']); }
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 != '') { ?>