Exemple #1
0
 public function actionCategory($id)
 {
     if (!Yii::$app->user->can('show', Yii::$app->user->identity)) {
         Yii::$app->session->setFlash('expires', true);
     }
     $category = Categories::find()->where('id=:id', [':id' => $id])->one();
     if (empty($category)) {
         throw new \yii\web\NotFoundHttpException(Yii::t('app', '<p>There are currently no pages of content associated with this category. Please check back again!</p>'));
     }
     return $this->render('category', compact('category'));
 }
Exemple #2
0
 public function init()
 {
     $this->categories = Categories::find()->orderBy('category')->all();
     $this->pdfs = Pdfs::find()->count();
 }