how to according domain to change web layout |
[eluser]Phil Sturgeon[/eluser]
You will need to put some code in a hook or a extended controller that checks $_SERVER['SERVER_NAME']. The way my CMS does this is possibly not the nicest or easiest way, but it works, so meh! 1.) Take a look at my Layout Lib. Save it to your libraries folder and auto load it. 2.) Now set up your folder structure. Quote:/ 3.) Make a controller extention application/libraries/MY_Controller.php Code: <?php if (!defined('BASEPATH')) exit('No direct script access allowed'); 4.) Make controllers children of this extended class. All frontend (user facing) controllers should use: Code: class Blog extends Public_controller { 5.) Add the right template tags, my layout template has $page_title, $page_output, etc. 6.) To use the layout library in your controllers: Code: $this->layout->title('Some title'); // optional, will generate its own title Instead of using $data = in your controllers, add items to $this->data. 7.) To include other files in your view folder, use the following code: Code: <?=$this->load->view($theme_view_folder.'viewname'); ?> Like I said, not exactly elegant, that will be worked on later ^_^. |
Messages In This Thread |
how to according domain to change web layout - by El Forum - 11-30-2008, 07:53 PM
how to according domain to change web layout - by El Forum - 12-01-2008, 12:46 AM
how to according domain to change web layout - by El Forum - 12-01-2008, 07:14 AM
how to according domain to change web layout - by El Forum - 12-01-2008, 07:44 AM
how to according domain to change web layout - by El Forum - 12-01-2008, 08:06 AM
how to according domain to change web layout - by El Forum - 12-01-2008, 10:38 AM
|