Welcome Guest, Not a member yet? Register   Sign In
DRY this view?
#3

Here is the update for these codes,
I move the method into Application/Core/MY_controller.php
Code:
    /***
     *     author: warren nazareno
     *  email: [email protected]
     *  purpose: will DRY the view codes.
     ***/
    function sview($data=array())
    {
        $this->data['header']         = $this->load->view('/public/templates/header', $this->data, TRUE);
        $this->data['menu']         = $this->load->view('/public/templates/menu', $this->data, TRUE);
        $this->data['body']         = $this->load->view('/public/templates/body', $this->data, TRUE);
        $this->data['navleft']         = $this->load->view('/public/templates/navleft', $this->data, TRUE);
        $this->data['navright']        = $this->load->view('/public/templates/navright', $this->data, TRUE);                
        $this->data['footer']         = $this->load->view('/public/templates/footer', $this->data, TRUE);
        
        $this->load->view('/public/templates/master', $this->data);
    }

Because it's throwing me error message when I put it under helper.
And now it's working fine.
Again if you guys have better suggestion please let me know.
Reply


Messages In This Thread
DRY this view? - by solidcodes - 09-12-2015, 10:09 PM
RE: DRY this view? - by solidcodes - 09-13-2015, 07:24 AM
RE: DRY this view? - by solidcodes - 09-13-2015, 07:56 AM
RE: DRY this view? - by pdthinh - 09-13-2015, 08:40 AM
RE: DRY this view? - by wishmaster - 09-13-2015, 10:20 PM
RE: DRY this view? - by solidcodes - 09-13-2015, 08:01 AM
RE: DRY this view? - by solidcodes - 09-13-2015, 08:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB