0
votes

I am using xampp and my document root in apache is set to htdocs directory by default. I download Codeigniter and unzip the project into this directory. It runs fine. Now I would like to use CI to create my own project. In the controllers folder I would like to create a folder named “myproject” and in the views folder of application folder, I would like to create a folder named “myproject_view” in which I will store all of my view files. My problem is I don’t know how to reset my config file (especially the route.php) for my project to work then.

CodeIgniter documentation doesn’t have a section to specify how to do this, the information given in URI Routing chapter is not enough for readers to understand this at all. Plus, What if I also would like to store my controler files in a nested folder (controllers > somefolder > someanotherfolders > etc) ? Thank you very much.

[UPDATE]
If you only leave all controller in controllers folder, and view files in the views folder, then things work out easily, what if you create a folder in teh controllers and a folder for view in the views folder. I guess you need to change your default route configuration. I would like to know HOW ?

1
what do you mean by "reset"? also, the last time I checked CI it was very well documented. - Karoly Horvath
If you only leave all controller in controllers folder, and view files in the views folder, then things work out easily, what if you create a folder in teh controllers and a folder for view in the views folder. I guess you need to change your default route configuration. I would like to know HOW ? - user1155788
It looks very clear to me.. codeigniter.com/user_guide/general/controllers.html#subfolders just rewrite the desired path to the subfolder - Karoly Horvath

1 Answers

0
votes

CodeIgniter's documentation covers Sub-Folders for Controllers.

Views on the other hand, are always loaded from controllers. Therefore, you can write:

$this->load->view('my_folder_name/my_view');

Routes are not required here.