Welcome Guest, Not a member yet? Register   Sign In
Query in CI Tutorial
#5

(01-08-2019, 01:29 PM)dave friend Wrote:
(01-07-2019, 05:57 PM)php_rocs Wrote: @Sovani Shreeniwas

Did you know that you could also do this...

       $this->load->view('templates/header', $data);
       $this->load->view('pages/'.$page);
       $this->load->view('templates/footer');

...and it would still work?

Or, because in this example we do not ask "view" to return a string it could be written

PHP Code:
$this->load
    
->view('templates/header'$data)
 
   ->view('pages/'.$page)
 
   ->view('templates/footer'); 

$data only needs to be passed to "view" once because "view" will save a copy of any data it is given.

Thanks all for the replies. Trying to understand the inputs from you.
Reply


Messages In This Thread
Query in CI Tutorial - by Sovani Shreeniwas - 01-07-2019, 02:49 AM
RE: Query in CI Tutorial - by Pertti - 01-07-2019, 03:40 AM
RE: Query in CI Tutorial - by php_rocs - 01-07-2019, 05:57 PM
RE: Query in CI Tutorial - by dave friend - 01-08-2019, 01:29 PM
RE: Query in CI Tutorial - by Sovani Shreeniwas - 01-09-2019, 03:28 AM



Theme © iAndrew 2016 - Forum software by © MyBB