<commit_before><?php
namespace admin\ngrest\base;

class Controller extends \admin\base\Controller
{
    public $modelClass = null;

    public function getModelClass()
    {
        return $this->modelClass;
    }

    public function actionIndex()
    {
        $class = $this->getModelClass();
        $model = new $class();
        $ngrest = new \admin\ngrest\NgRest($model->getNgRestConfig());

        return $ngrest->render(new \admin\ngrest\render\RenderCrud());
    }
}<commit_msg>[+] added ng controler split to overwrite a local ng config for a controller (not have to use model ng config)<commit_after><?php
namespace admin\ngrest\base;

class Controller extends \admin\base\Controller
{
    public $modelClass = null;
    
    private $_model = null;

    public function getModelClass()
    {
        return $this->modelClass;
    }
    
    public function getModelObject()
    {
        if ($this->_model !== null) {
            return $this->_model;
        }
        
        $class = $this->getModelClass();
        
        $this->_model = new $class();
        return $this->_model;
    }
    
    public function getNgRestConfig()
    {
        return $this->getModelObject()->getNgRestConfig();
    }

    public function actionIndex()
    {
        $ngrest = new \admin\ngrest\NgRest($this->getNgRestConfig());

        return $ngrest->render(new \admin\ngrest\render\RenderCrud());
    }
}
{'fraction_non_alphanumeric': 0.1272984441301273, 'fraction_numerical': 0.0, 'mean_word_length': 2.451219512195122, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3617347', 'n_tokens_mistral': 421, 'n_tokens_neox': 412, 'n_words': 96}