Welcome Guest, Not a member yet? Register   Sign In
View Conundrum

I have a standard view file for the <div id="content"></div> content of all my sub pages. But as you can imagine you'll want some custom elements within these content divs on some pages but not on others.

How can I approach this? Would it work to keep the code for the extra element in the view but use a PHP if isset statement so if a variable with the information was found the code would be used or if no variable was found the code would be ignored.

What is the best way of doing this?

echo "<div id="account_profile">&lt;?php foreach ($account_profile as $foo):?&gt;<p>&lt;?php echo $foo ?&gt;<p>&lt;?php endforeach; ?&gt;</div>"

Theme © iAndrew 2016 - Forum software by © MyBB