Welcome Guest, Not a member yet? Register   Sign In
views stored in completely different locations
#1

[eluser]Matthew Lanham[/eluser]
Hi,

Im looking to create a kind of CMS that will have a central CI core, and store the views in a different folder location completely something like:

Main CI core here:

/home/ci_core/public_html/

Views stored:

/home/site1/public_html/
/home/site2/public_html/

How could i achieve this?

I also need to have these sites referencing to the core
#2

[eluser]ejangi[/eluser]
So you want just the views in these folders? Not the controllers or anything else?

I haven't done this before, but I would try doing something to the effect of:
Code:
$this->load->view('../../../'.$site_name.'/my_view.php');
and play around with that for a while. Some servers don't like relative includes like that and if that's the case I would look at overwriting the Loader library to use an absolute path.
#3

[eluser]esra[/eluser]
I think you want to minimize access to both your system and application files and minimize the number of files accessible from your sites. All of your application files for both sites can remain in protected directory paths. Only the index.php for site1 and site2 need to be accessible. One possible way is to do something like this:

home/public_html/system/
home/public_html/application/site1/
home/public_html/application/site2/
home/public_html/www/site1/index.php
home/public_html/www/site1/.htaccess
home/public_html/www/site2/index.php
home/public_html/www/site2/.htaccess

You just need to set the first two paths in the index.php (bootstrap loader) for each site to the paths for your system and application files relative to public_html. You need to include the paths to the application directories for site1 and site2 in their respective index.php files ($application_folder = "application/site1"; or $application_folder = "application/site2"; depending on which index.php file).

From your web console, you can map ste domains to the directory paths where the index.php files reside and change the base_url variable in the config.php file for each application to identify the domain of each site.

For system/ and application/ you can add their own .htaccess files with a line denying acess to those directories for their protection.




Theme © iAndrew 2016 - Forum software by © MyBB