Welcome Guest, Not a member yet? Register   Sign In
include external php in the view through a loop and pass variables to it
#3

[eluser]Spredemann[/eluser]
as I said, my page is made up of parts, like the default header and footer, plus pieces like the navigation sidebar, the main content area, a right sidebar with friends and stuff.

I thought that doing so would be useful to be able to reuse the same templates over and over and when I modify the template, it will be modified everywhere. I don't know if that is a good practice or common as I am also kind of new to php, coming from an actionscript background.

Anyway, as the comments are right in the middle of the html code, I thought that I would put some php code into the view itself to loop through the data sent by the controller containing a multidimensional array of comments... Is that a good idea or is there another way that I'm missing???

The header and footer are being called by the controller though..

I have found that doing a
Code:
$this->load->view ('viewpath', $data)
also works in the view.. Now the question is... is this good practice? is this how people do?! I'm lost!


Messages In This Thread
include external php in the view through a loop and pass variables to it - by El Forum - 02-05-2012, 12:05 PM



Theme © iAndrew 2016 - Forum software by © MyBB