Views within Views |
[eluser]kevinprince[/eluser]
Im stuck and have been for a hour or so, im building a newsletter generator, which outputs in a text box. If i do $var = $this->load->view('newsletter', $data); It loads the view, and doesnt seem to keep it in PHP, for the actual view call. Any Ideas? Kevin
[eluser]Tom Glover[/eluser]
This is how I create a similar function. Template file Code: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> The left view file: (Simple Login) Code: <?php The Right Content: Code: <h2>Welcome to O<em>PM</em>S</h2> and finally the controller that brings it all together: Code: class Welcome extends Controller { EDIT: By the way all you needed to add in the $var is True to return the file as a string not and output, this will then allow you to output it by echoing the $var where you need it. this is shown in the example above.
|
Welcome Guest, Not a member yet? Register Sign In |