Welcome Guest, Not a member yet? Register   Sign In
function requires loop data
#1

[eluser]Unknown[/eluser]
Hello,

How can I pass a functions data into a view if it requires the table data in the views foreach loop.

e.g view_index.php

Code:
foreach ($posts as $post) {
if (has_subscribed($post->id)) {
echo "has subscribed";
}
}

The has_subscribed function is querying the database using the post->id and returning true/false.

Now obviously I can't place that function in my view?
So how do I pass that data from my controller to my view?


Messages In This Thread
function requires loop data - by El Forum - 04-26-2013, 06:01 PM
function requires loop data - by El Forum - 04-26-2013, 09:47 PM
function requires loop data - by El Forum - 04-27-2013, 05:38 AM
function requires loop data - by El Forum - 04-27-2013, 05:43 AM



Theme © iAndrew 2016 - Forum software by © MyBB