EllisLab text mark
Advanced Search
     
How to change Controllers/Models source dir
Posted: 16 June 2010 04:16 PM   [ Ignore ]
Joined: 2009-06-18
279 posts

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

 
Posted: 16 June 2010 04:39 PM   [ Ignore ]   [ # 1 ]   [ Rating: 0 ]
Joined: 2009-03-30
1303 posts

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.

 
Posted: 16 June 2010 04:45 PM   [ Ignore ]   [ # 2 ]   [ Rating: 0 ]
Joined: 2009-06-18
279 posts

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.

 
Posted: 16 June 2010 04:54 PM   [ Ignore ]   [ # 3 ]   [ Rating: 0 ]
Avatar
Joined: 2009-12-08
1804 posts

You can also change the system and application folders in index.php

 Signature 

@basdflasjk | BitAuth: Authentication and Role-based Permissions | Session Library Replacement


Please read the User Guide! (Upgrading from a previous version?)

 
Posted: 16 June 2010 04:55 PM   [ Ignore ]   [ # 4 ]   [ Rating: 0 ]
Joined: 2009-06-18
279 posts
noctrum - 16 June 2010 08:54 PM

You can also change the system and application folders in index.php

This is what I am trying to do now. But doesn’t go too well.

Edit:

At least I get a good message

An Error Was Encountered

Unable to load the requested file: welcome_message.php

:D

Later:

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

 
Posted: 12 November 2012 03:33 AM   [ Ignore ]   [ # 5 ]   [ Rating: 0 ]
Avatar
Joined: 2011-08-10
9 posts

Couldn’t you tell it without someone specifically saying it? OK so now I am saying it, please explain the process.