how to according domain to change web layout |
[eluser]elfkid[/eluser]
[quote author="Chamyto" date="1228135572"]what do you mean? templates?[/quote] yes
[eluser]Rey Philip Regis[/eluser]
Template? Try using Template Library for codeigniter http://www.williamsconcepts.com/ci/codei...plate/?v14
[eluser]obiron2[/eluser]
I think he means How do I apply different a different style sheet for each subdomain.
[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 ^_^. |
Welcome Guest, Not a member yet? Register Sign In |