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

[eluser]Spredemann[/eluser]
OK so I have been using codeIgniter for a little more than a week and I have gotten stuck for the first time...

What I want to achieve is:

- display a user profile page with info grabbed from the db (done)
- display comments that other users have posted on the profile (trouble!!!)

The thing is... this profile page is all done in parts, where the sidebar is one thing, the main profile where the info is displayed is another, header another, and so on...

The comments are also a separate php file containing its html formatting, like a template. The reason why I'm doing so is to be able to easily change the design in one file and it will update the way comments are displayed in both profile pages, pictures, etc.

In this comment template I have variables related to the commenter information, plus the comment itself.

Ok so the main question is pretty much what the title says:

How can I include these comments in my view, through a loop, while each time sending to the include the data from the commenter and the comment itself?

ps:the loop part is not the problem, mostly the data sending and if there is any other obvious way to do this that I'm not seeing...

thanks in advance!


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



Theme © iAndrew 2016 - Forum software by © MyBB