Welcome Guest, Not a member yet? Register   Sign In
Smart architecture for controller / views (body / header / footer) in CodeIgniter 3
#3

(01-05-2020, 09:18 AM)InsiteFX Wrote: CodeIgniter 3 has a nice hidden gem that's great for this, see below code.

PHP Code:
public function getHeader()
{
    $data['header'] = $this->load->view('templates/javascript'''TRUE)
            .$this->load->view('templates/css'''TRUE)
            .$this->load->view('templates/title-description'$dataHeaderTRUE)
            .$this->load->view('templates/favicon'''TRUE);

    // Loads it global to all views.
    $this->load->vars($data);


Interesting, it's still not clear for me where the function should be placed.
Reply


Messages In This Thread
RE: Smart architecture for controller / views (body / header / footer) in CodeIgniter 3 - by imabot - 01-05-2020, 11:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB