<?php use yii\helpers\Html; use yii\grid\GridView; use source\LuLu; use source\core\lib\Common; use source\models\Takonomy; use source\models\TakonomyCategory; /* @var $this yii\web\View */ /* @var $searchModel app\models\search\TakonomySearch */ /* @var $dataProvider yii\data\ActiveDataProvider */ $this->title='分类项'; $category=LuLu::getGetValue('category'); $categoryModel = TakonomyCategory::findOne(['id'=>$category]); $this->addBreadcrumbs([ ['分类管理',['/takonomy']], $categoryModel['name'], ]); ?> <div class="mod"> <div class="mod-head"> <h3> <span class="pull-left"><?= $categoryModel['name']?></span> <span class="pull-right"><?= Html::a('新建', ['create','category'=>$category], ['class' => 'btn btn-xs btn-primary mod-site-save']) ?></span> <span class="pull-right"><?= Html::a('返回', ['/takonomy/takonomy-category/index'], ['class' => 'btn btn-xs btn-primary mod-site-save']) ?></span>
/** * Finds the TakonomyCategory model based on its primary key value. * If the model is not found, a 404 HTTP exception will be thrown. * @param string $id * @return TakonomyCategory the loaded model * @throws NotFoundHttpException if the model cannot be found */ protected function findModel($id) { if (($model = TakonomyCategory::findOne(['id' => $id])) !== null) { return $model; } else { throw new NotFoundHttpException('The requested page does not exist.'); } }