original_string: public function actionNewCategory()
      {
          $model = new Category();
          $model->visible = 1;
          $model->sort = 0;
          if ($model->load(Yii::$app->request->post()) && $model->save()) {
              Log::info('Category added', $model->id, __METHOD__);
              $this->success(Yii::t('podium/flash', 'New category has been created.'));
              return $this->redirect(['admin/categories']);
          }
          return $this->render('category', [
              'model' => $model,
              'categories' => Category::find()->orderBy(['sort' => SORT_ASC, 'id' => SORT_ASC])->all()
          ]);
      }
code: public function actionNewCategory()
      {
          $model = new Category();
          $model->visible = 1;
          $model->sort = 0;
          if ($model->load(Yii::$app->request->post()) && $model->save()) {
              Log::info('Category added', $model->id, __METHOD__);
              $this->success(Yii::t('podium/flash', 'New category has been created.'));
              return $this->redirect(['admin/categories']);
          }
          return $this->render('category', [
              'model' => $model,
              'categories' => Category::find()->orderBy(['sort' => SORT_ASC, 'id' => SORT_ASC])->all()
          ]);
      }
code_tokens: public function actionNewCategory ( ) { $ model = new Category ( ) ; $ model -> visible = 1 ; $ model -> sort = 0 ; if ( $ model -> load ( Yii :: $ app -> request -> post ( ) ) && $ model -> save ( ) ) { Log :: info ( 'Category added' , $ model -> id , __METHOD__ ) ; $ this -> success ( Yii :: t ( 'podium/flash' , 'New category has been created.' ) ) ; return $ this -> redirect ( [ 'admin/categories' ] ) ; } return $ this -> render ( 'category' , [ 'model' => $ model , 'categories' => Category :: find ( ) -> orderBy ( [ 'sort' => SORT_ASC , 'id' => SORT_ASC ] ) -> all ( ) ] ) ; }
docstring: Adding new category.
  @return string|Response
docstring_tokens: Adding new category .