src/ngrest/base/Controller.php
public function actionIndex($inline = false, $relation = false, $arrayIndex = false, $modelClass = false, $modelSelection = false)
    {
        $apiEndpoint = $this->model->ngRestApiEndpoint();

        $config = $this->model->getNgRestConfig();

        $userSortSettings = Yii::$app->adminuser->identity->setting->get('ngrestorder.admin/'.$apiEndpoint, false);
        
        if ($userSortSettings && is_array($userSortSettings) && $config->getDefaultOrder() !== false) {
            $config->defaultOrder = [$userSortSettings['field'] => $userSortSettings['sort']];
        }
        
        // generate crud renderer
        $crud = Yii::createObject($this->renderCrud);
        $crud->setModel($this->model);
        $crud->setSettingButtonDefinitions($this->globalButtons);
        $crud->setIsInline($inline);
        $crud->setModelSelection($modelSelection);
        if ($relation && is_numeric($relation) && $arrayIndex !== false && $modelClass !== false) {
            $crud->setRelationCall(['id' => $relation, 'arrayIndex' => $arrayIndex, 'modelClass' => $modelClass]);
        }
        
        // generate ngrest object from config and render renderer
        $ngrest = new NgRest($config);
        return $ngrest->render($crud);
    }
public function actionIndex($inline = false, $relation = false, $arrayIndex = false, $modelClass = false, $modelSelection = false)
    {
        $apiEndpoint = $this->model->ngRestApiEndpoint();

        $config = $this->model->getNgRestConfig();

        $userSortSettings = Yii::$app->adminuser->identity->setting->get('ngrestorder.admin/'.$apiEndpoint, false);
        
        if ($userSortSettings && is_array($userSortSettings) && $config->getDefaultOrder() !== false) {
            $config->defaultOrder = [$userSortSettings['field'] => $userSortSettings['sort']];
        }
        
        // generate crud renderer
        $crud = Yii::createObject($this->renderCrud);
        $crud->setModel($this->model);
        $crud->setSettingButtonDefinitions($this->globalButtons);
        $crud->setIsInline($inline);
        $crud->setModelSelection($modelSelection);
        if ($relation && is_numeric($relation) && $arrayIndex !== false && $modelClass !== false) {
            $crud->setRelationCall(['id' => $relation, 'arrayIndex' => $arrayIndex, 'modelClass' => $modelClass]);
        }
        
        // generate ngrest object from config and render renderer
        $ngrest = new NgRest($config);
        return $ngrest->render($crud);
    }
public function actionIndex ( $ inline = false , $ relation = false , $ arrayIndex = false , $ modelClass = false , $ modelSelection = false ) { $ apiEndpoint = $ this -> model -> ngRestApiEndpoint ( ) ; $ config = $ this -> model -> getNgRestConfig ( ) ; $ userSortSettings = Yii :: $ app -> adminuser -> identity -> setting -> get ( 'ngrestorder.admin/' . $ apiEndpoint , false ) ; if ( $ userSortSettings && is_array ( $ userSortSettings ) && $ config -> getDefaultOrder ( ) !== false ) { $ config -> defaultOrder = [ $ userSortSettings [ 'field' ] => $ userSortSettings [ 'sort' ] ] ; } // generate crud renderer $ crud = Yii :: createObject ( $ this -> renderCrud ) ; $ crud -> setModel ( $ this -> model ) ; $ crud -> setSettingButtonDefinitions ( $ this -> globalButtons ) ; $ crud -> setIsInline ( $ inline ) ; $ crud -> setModelSelection ( $ modelSelection ) ; if ( $ relation && is_numeric ( $ relation ) && $ arrayIndex !== false && $ modelClass !== false ) { $ crud -> setRelationCall ( [ 'id' => $ relation , 'arrayIndex' => $ arrayIndex , 'modelClass' => $ modelClass ] ) ; } // generate ngrest object from config and render renderer $ ngrest = new NgRest ( $ config ) ; return $ ngrest -> render ( $ crud ) ; }
Render the ngrest default index template.

@param string $inline
@param string $relation
@param string $arrayIndex
@param string $modelClass
@param string $modelSelection
@throws Exception
@return string
Render the ngrest default index template .