public function actionCreatePage()
    {
        $this->menuFlush();
        $model = new Nav();
        $fromDraft = $this->postArg('use_draft');
        $parentNavId = $this->postArg('parent_nav_id');
        $navContainerId = $this->postArg('nav_container_id');
        
        if (!empty($parentNavId)) {
            $navContainerId = Nav::findOne($parentNavId)->nav_container_id;
        }
        
        if (!empty($fromDraft)) {
            $create = $model->createPageFromDraft($parentNavId, $navContainerId, $this->postArg('lang_id'), $this->postArg('title'), $this->postArg('alias'), $this->postArg('description'), $this->postArg('from_draft_id'), $this->postArg('is_draft'));
        } else {
            $create = $model->createPage($parentNavId, $navContainerId, $this->postArg('lang_id'), $this->postArg('title'), $this->postArg('alias'), $this->postArg('layout_id'), $this->postArg('description'), $this->postArg('is_draft'));
        }
        
        if (is_array($create)) {
            Yii::$app->response->statusCode = 422;
        }
        
        return $create;
    }
public function actionCreatePage()
    {
        $this->menuFlush();
        $model = new Nav();
        $fromDraft = $this->postArg('use_draft');
        $parentNavId = $this->postArg('parent_nav_id');
        $navContainerId = $this->postArg('nav_container_id');
        
        if (!empty($parentNavId)) {
            $navContainerId = Nav::findOne($parentNavId)->nav_container_id;
        }
        
        if (!empty($fromDraft)) {
            $create = $model->createPageFromDraft($parentNavId, $navContainerId, $this->postArg('lang_id'), $this->postArg('title'), $this->postArg('alias'), $this->postArg('description'), $this->postArg('from_draft_id'), $this->postArg('is_draft'));
        } else {
            $create = $model->createPage($parentNavId, $navContainerId, $this->postArg('lang_id'), $this->postArg('title'), $this->postArg('alias'), $this->postArg('layout_id'), $this->postArg('description'), $this->postArg('is_draft'));
        }
        
        if (is_array($create)) {
            Yii::$app->response->statusCode = 422;
        }
        
        return $create;
    }
public function actionCreatePage ( ) { $ this -> menuFlush ( ) ; $ model = new Nav ( ) ; $ fromDraft = $ this -> postArg ( 'use_draft' ) ; $ parentNavId = $ this -> postArg ( 'parent_nav_id' ) ; $ navContainerId = $ this -> postArg ( 'nav_container_id' ) ; if ( ! empty ( $ parentNavId ) ) { $ navContainerId = Nav :: findOne ( $ parentNavId ) -> nav_container_id ; } if ( ! empty ( $ fromDraft ) ) { $ create = $ model -> createPageFromDraft ( $ parentNavId , $ navContainerId , $ this -> postArg ( 'lang_id' ) , $ this -> postArg ( 'title' ) , $ this -> postArg ( 'alias' ) , $ this -> postArg ( 'description' ) , $ this -> postArg ( 'from_draft_id' ) , $ this -> postArg ( 'is_draft' ) ) ; } else { $ create = $ model -> createPage ( $ parentNavId , $ navContainerId , $ this -> postArg ( 'lang_id' ) , $ this -> postArg ( 'title' ) , $ this -> postArg ( 'alias' ) , $ this -> postArg ( 'layout_id' ) , $ this -> postArg ( 'description' ) , $ this -> postArg ( 'is_draft' ) ) ; } if ( is_array ( $ create ) ) { Yii :: $ app -> response -> statusCode = 422 ; } return $ create ; }
Create a new nav entry for the type page (nav_id will be created.

This methods is execute via post.
Create a new nav entry for the type page ( nav_id will be created .