CodeIgniter Forums
CI with Bootstrap template and Ion Auth - 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 with Bootstrap template and Ion Auth (/showthread.php?tid=58579)



CI with Bootstrap template and Ion Auth - El Forum - 06-26-2013

[eluser]Unknown[/eluser]
I'm trying to include Ion Auth in a Bootstrap template with Codeigniter. But I cant get it to work properly.

I'm pretty new with CI so maybe someone can help me on this one?

My auth.php controller files calls template files like this:

Code:
$this->_render_page('auth/login', $this->data);

Now i want to include this in my template as 'content' like this:

Code:
$this->load->view('template/user', array("content" => $this->_render_page('auth/login',$this->data array())));

But his doesn't work, it places the auth/login page above my template/user view. does anyone know how to solve this?

It would help me a lot


CI with Bootstrap template and Ion Auth - El Forum - 06-27-2013

[eluser]Unknown[/eluser]
Code:
function _render_page($view, $data = null, $render = false)
    {
        $this->data = (empty($data)) ? $this->data : $data;
        $this->data['view'] = $view;
        $view_html = $this->load->view('template/user', $this->$data, $render);
        if (!$render) return $view_html;
    }

try adjusting the _render_page function to load your template page and pass the auth view as a variable in $this->data