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

I want to load view into a variable but also want to pass some dynamic data to the view? 
please help

This code works:
$result["view"] = $this->load->view('template/test', '', TRUE);

This returns output directly to the browser:
$result["view"] = $this->load->view('template/test', array("something"=>"something"), TRUE);

https://codeigniter.com/user_guide/general/views.html
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