Welcome Guest, Not a member yet? Register   Sign In
Load view into a variable?
#3

hi just create an an array called 'anything' like this
$page_data['myvariable']='something'; // the myvariable(or whatever you write) will become a variable once passed to the view, then in the second parameter pass it there like this
$result["view"] = $this->load->view('template/test', '$page_data'); // here you only pass the array name not the whole "$page_data['myvariable']" remember it dosen't have to be called myvariable it can be anything you like also page_data can be anything you like.
Reply


Messages In This Thread
Load view into a variable? - by dysko - 03-01-2016, 05:25 PM
RE: Load view into a variable? - by albertleao - 03-01-2016, 09:10 PM
RE: Load view into a variable? - by pizzel - 03-01-2016, 10:57 PM
RE: Load view into a variable? - by PaulD - 03-05-2016, 03:25 AM



Theme © iAndrew 2016 - Forum software by © MyBB