Welcome Guest, Not a member yet? Register   Sign In
[newbie] help with passing variables
#1

[eluser]Unknown[/eluser]
I have a simple view that uses a database query to retrieve information from a table called "posts"

Code:
<?php foreach($posts as $post) { ?>

<?php echo $post->email; ?>
  
<?php if (is_subscribed($post->id)) {

echo "Subscribed";

?>

    
  <? } ?>

As you can see I'm using a function in my view.
That function queries another table and using the id, returns a true/false.

From my understanding, placing functions in the view is bad practice. How can I achieve the same result by placing it in a controller?




Theme © iAndrew 2016 - Forum software by © MyBB