CodeIgniter Forums
CI default layout - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: CI default layout (/showthread.php?tid=39867)



CI default layout - El Forum - 03-23-2011

[eluser]girish[/eluser]
I want to set the default layout in my website. Please provide me the solution to set the layout in a standard way of CodeIgniter. Please help Sad


CI default layout - El Forum - 03-23-2011

[eluser]BrokenLegGuy[/eluser]
The method that I'm currently using is here (the first method) http://codeigniter.com/wiki/Displaying_Multiple_Views/

Other people use template libraries and there are a bunch of different ones that people have built out there. You'll need to search for codeigniter templates and try a few until you find one you like. You'll find many right here in the forum.

Good luck,

Ed


CI default layout - El Forum - 03-24-2011

[eluser]girish[/eluser]
okay i check


CI default layout - El Forum - 03-24-2011

[eluser]alexinthebox[/eluser]
[quote author="girish" date="1300903229"]I want to set the default layout in my website. Please provide me the solution to set the layout in a standard way of CodeIgniter. Please help Sad[/quote]

please teach me on how to do that i encountered errors.


CI default layout - El Forum - 03-24-2011

[eluser]alexinthebox[/eluser]
how to make template on view for my codeigniter project


CI default layout - El Forum - 03-26-2011

[eluser]Nicolas Santos[/eluser]
hello,

i personnally use this layout library - simply does the job as CI in fact Big Grin
http://codeigniter.com/wiki/layout_library/

i modified this lib to display ajax methods with a layout if it is not an ajax request : if it is an ajax request : no layout. plain and simple

Code:
function view($view, $data=null, $return=false) {
        $loadedData = $data;
        if ($this->ci->input->is_ajax_request() === FALSE) {
            $loadedData = array();
            $loadedData['content_for_layout'] = $this->obj->load->view($view, $data, TRUE);
            $view = "templates/{$this->layout}";
        }
        if ($return) {
            return $this->obj->load->view($view, $loadedData, true);
        }
        $this->obj->load->view($view, $loadedData, false);
    }