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

[eluser]georgerobbo[/eluser]
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?

Code:
&lt;?php
if(isset($account_profile))
{
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>"
}
else
{
}
?&gt;


Messages In This Thread
View Conundrum - by El Forum - 09-03-2009, 09:06 AM



Theme © iAndrew 2016 - Forum software by © MyBB