Error while changing path to codeigniter views folder!

Asked

Viewed 377 times

1

Following the installation steps of the official CI guide, I changed the folder views out of the folder application - now inside public_html. I get ERROR message on home page

Your views folder path does not seem to be set correctly. Please open the following file and fix this: index.php

I set it up like this $view_folder = 'public_html'; How to correctly specify the path of the views folder that is now in the folder public_html?

1 answer

0

Open the file Loader.php which is in the folder ./system/core/Loader.php and change the following line (usually on line 130 of version 2.0):

$this->_ci_view_paths = array(APPPATH.'views/' => TRUE);

Change with the new path you want, for example:

$this->_ci_view_paths = array(FCPATH.'public_html/views' => TRUE);
  • I thank you for your help, friend! I’m using version 3.0 of Codeigniter - See what I found in Loader.php > public Function add_package_path($path, $view_cascade = TRUE) { $path = rtrim($path, /'). '/'; array_unshift($this->_ci_library_paths, $path); array_unshift($this->_ci_model_paths, $path); array_unshift($this->_ci_helper_paths, $path); $this->_ci_view_paths = array($path.'public_html' => $view_cascade) + $this->_ci_view_paths; // Add config path file $config =& $this->_ci_get_component('config'); $config->_config_paths[] = $path; Return $this; }

Browser other questions tagged

You are not signed in. Login or sign up in order to post.