Loader Class View Codeigniter -


in codeigniter systems core loader.php there $this->_ci_view_paths = array(apppath.'views/' => true); function

if wanted change path $this->_ci_view_paths = array(apppath.'views/template'=> true);function.

would able in my_loader.php overwrite default location.

i have hmvc not changing view path

public function view($view, $vars = array(), $return = false) {         list($path, $_view) = modules::find($view, $this->_module, 'views/template/');          if ($path != false) {             $this->_ci_view_paths = array($path => true) + $this->_ci_view_paths;             $view = $_view;         }          return $this->_ci_load(array('_ci_view' => $view, '_ci_vars' => $this->_ci_object_to_array($vars), '_ci_return' => $return));     } 

because able $this->load->view('user/user_list', $data); rather $this->load->view('template/user/user_list', $data);

i have done before. wanted "views" directory come main public_html directory.

this how did (make new file (my_loader.php), within core directory inside application folder);

class my_loader extends ci_loader {      public function __construct()     {         $this->_ci_view_paths = array(fcpath . 'views/' => true);         $this->_ci_ob_level  = ob_get_level();         $this->_ci_library_paths = array(apppath, basepath);         $this->_ci_helper_paths = array(apppath, basepath);         $this->_ci_model_paths = array(apppath);          log_message('debug', "my_loader class initialized");     }         } 

then, move views folder, anywhere wanted (fcpath . 'views/').

i never recommend editing system files. if need change anything, extend class.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -