itstructure /
yii2-template-multilanguage
| 1 | <?php |
||
| 2 | |||
| 3 | namespace app\controllers; |
||
| 4 | |||
| 5 | use app\models\About; |
||
| 6 | use yii\filters\{AccessControl, VerbFilter}; |
||
| 7 | use yii\helpers\ArrayHelper; |
||
| 8 | |||
| 9 | /** |
||
| 10 | * Class AboutController |
||
| 11 | * |
||
| 12 | * @package app\controllers |
||
| 13 | */ |
||
| 14 | class AboutController extends BaseController |
||
| 15 | { |
||
| 16 | /** |
||
| 17 | * @return array |
||
| 18 | */ |
||
| 19 | public function behaviors() |
||
| 20 | { |
||
| 21 | return ArrayHelper::merge(parent::behaviors(), [ |
||
| 22 | 'access' => [ |
||
| 23 | 'class' => AccessControl::class, |
||
| 24 | 'rules' => [ |
||
| 25 | [ |
||
| 26 | 'allow' => true, |
||
| 27 | 'actions' => ['index'], |
||
| 28 | 'roles' => ['?', '@'], |
||
| 29 | ], |
||
| 30 | ], |
||
| 31 | ], |
||
| 32 | 'verbs' => [ |
||
| 33 | 'class' => VerbFilter::class, |
||
| 34 | 'actions' => [ |
||
| 35 | 'index' => ['get'], |
||
| 36 | ], |
||
| 37 | ], |
||
| 38 | ]); |
||
| 39 | } |
||
| 40 | |||
| 41 | /** |
||
| 42 | * Displays about page. |
||
| 43 | * |
||
| 44 | * @return string |
||
| 45 | */ |
||
| 46 | public function actionIndex() |
||
| 47 | { |
||
| 48 | $model = About::getDefaultAbout(); |
||
| 49 | |||
| 50 | $this->setMetaParams($model); |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 51 | |||
| 52 | return $this->render('index', [ |
||
| 53 | 'model' => $model |
||
| 54 | ]); |
||
| 55 | } |
||
| 56 | } |
||
| 57 |