Quote:
Originally Posted by TalkVirginia
I have a mod I'm working on and in a certain place in my script I'm not sure if I should place the html code in a template or keep it in my script.
example:
PHP Code:
if ( $someval )
{
$displaytitle = "<a href=\"$link\" class=\"producttitle\" title=\"$title\" style=\"width: $gridcellwidthpx\">$title</a>";
}
/* Render template here */
Does what I'm asking make sense?
In the example above, I'm using the conditionals in the script as opposed to using template conditions to determine if something is displayed.
Which way is better?
|
Depends i'd suppose. Are you the only one thats going to use this script? Do you anticipate others using it as well?
If you're the only one using it, do whatever is easiest for you. But if you're going to share it, you might as well save yourself the headache and make it simple as possible for the user.