• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
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;


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.