From: "Richard Davey" <[EMAIL PROTECTED]> > Because you're injecting variables directly into your HTML, which some > of the time might be ok - but what if the $row_array doesn't contain > "name" ? You'll raise an Error Warning without first passing it > through some kind of test (or function).
Only if you have error_reporting() set high. If you have a PHP templating solution, you'd turn error_reporting() down when you included the PHP templates so you didn't get a warning. > You assume that the PHP short-tags are enabled (<? ?>) for > echoing variables and while most the time they are, you shouldn't bank > on it in code (incidentally, you don't need the trailing ; on the > short-tag echos). You're relying on web-server writable directories when you use Smarty. It's all a trade-off. > But what if you want to take your template and perform a bit more than > just mere variable substitution on it? How about highlighting all > words that match a search term, or applying logic to a display block > based on a user status? You can do this with output buffering and PHP functions. Smarty just provides you a different interface. <?php start_highlight(); ?> Paragraph Text <?php end_highlight(); ?> vs. {section type="highlight"} Paragraph Text {/section} Yeah, I know that's not quite the Smarty syntax, but you get the idea. Smarty just provides an easy interface to a lot of these things. It's a tool, like a lot of others have said. :) ---John Holmes... -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php