Blame view

common/modules/blog/controllers/AjaxController.php 603 Bytes
77d30544   Yarik   Начата разработка...
1
  <?php
18ac4398   Yarik   Добавлен блог (ча...
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
  namespace common\modules\blog\controllers;
  
  use common\models\Language;
  use common\modules\blog\models\ArticleCategoryLang;
  use yii\web\Controller;
  use yii\web\NotFoundHttpException;
  
  class AjaxController extends Controller
  {
      public function actionCategoryForm($lang_id)
      {
          $model = Language::findOne($lang_id);
          if(!$model) {
              throw new NotFoundHttpException('Language not found');
          }
          $category_lang = new ArticleCategoryLang();
          return $this->renderPartial('_category_form', ['model' => $model, 'category_lang' => $category_lang]);
      }
  }