Welcome Guest, Not a member yet? Register   Sign In
CI default layout
#1

[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
#2

[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
#3

[eluser]girish[/eluser]
okay i check
#4

[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.
#5

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

[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);
    }




Theme © iAndrew 2016 - Forum software by © MyBB