2 ms·
When you end up with flow-control, and other such complicated constructs, inside your templates, either the designers are already smart enough to "modify or com
by derefr 17y ago
When you end up with flow-control, and other such complicated constructs, inside your templates, either the designers are already smart enough to "modify or completely redesign it from scratch, all without intervention from the programmer", or the programmer will need to be "messing with templates" anyway, to help the designers fix their logic errors, which no amount of abstraction will help overcome.
The problems solved by Smarty could be solved simply with a single try-catch block around the rendering-kickoff logic (that forwards to a nice 500 error page if something happens), and a convention to not do any business-layer stuff within the templates. [Also, source control + a dev/testing server to deploy on so "break[ing] application code" isn't a concern, but this should really, really not need to be mentioned.] This is exactly what I've done on any [non-framework] PHP project I've touched, and no one has ever complained that it was hard to edit the views.