CodeIgniter Forums
How to change Controllers/Models source dir - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: How to change Controllers/Models source dir (/showthread.php?tid=31373)



How to change Controllers/Models source dir - El Forum - 06-16-2010

[eluser]Mareshal[/eluser]
I need to load controllers and models from a different folder than the default one. I am using a Linux system.

I am building a simple CI application for some people, for use on a shared hosting I own. But I want to give them access only to /views folder and some /config files. And this is why I need to store the controllers and models in a different folder on the same level as /public_html folder or maybe somewhere in the linux system.

I consider this would be a better solution than encoding files


How to change Controllers/Models source dir - El Forum - 06-16-2010

[eluser]pickupman[/eluser]
How about creating a FTP account with rights only to views folder? I find a user shouldn't be changing anything in the config files. Most of those option values are for us dev's. Anything I feel an end user should have access to, I create a config/settings controller. Create a settings table where you add your option:values. I have a master controller(see Base controllers in signature) that queries the DB to grab the settings and make them available in your controller/views.


How to change Controllers/Models source dir - El Forum - 06-16-2010

[eluser]Mareshal[/eluser]
I was thinking to this too, but customers need cPanel or DirectAdmin.

Anyway I found this: http://ericlbarnes.com/blog/post/codeigniter-change-views-location . Trying to make it now.


How to change Controllers/Models source dir - El Forum - 06-16-2010

[eluser]danmontgomery[/eluser]
You can also change the system and application folders in index.php


How to change Controllers/Models source dir - El Forum - 06-16-2010

[eluser]Mareshal[/eluser]
[quote author="noctrum" date="1276736051"]You can also change the system and application folders in index.php[/quote]
This is what I am trying to do now. But doesn't go too well.

Edit:

At least I get a good message

Quote:An Error Was Encountered

Unable to load the requested file: welcome_message.php
Big Grin

Later:

Ok, I made it. If someone wants to know how just say it.


How to change Controllers/Models source dir - El Forum - 11-12-2012

[eluser]zee[/eluser]
Couldn't you tell it without someone specifically saying it? OK so now I am saying it, please explain the process.