smarty (template engine), problems
in the previous post, i quoted the terms "programmer" and "web designer" because these positions do not actually exist in my case, or in the case of anyone who writes all the presentation and logic code him/herself. the use of these terms and distinction between the roles of the two in all the literature suggests that a template engine is not a suitable solution for a single developer. in fact, the main selling point of "smarty" is that it keeps these two people from stepping on each other's toes.
#1 the first problem is that smarty does not solve my dilemna. i wanted a simple way to make my code look cleaner. so what is a good solution for the lone programmer wishing to separate presentation from content?...
#2 smarty uses its own language in order to compile its templates into php code. each tag uses "{" and "}" which means that when including any javascript or other php functions, special tags such as {literal}, {php}, and {rdelim} and {ldelim} must be used. learning this is not a problem. the problem is that i have some pages which use a template and some that do not. both include the same file containing php functions. for the templated page, it wants {php} and the non-templated page wants < ? php. this means i cannot use the same include file for both. i guess the solution is that all the pages should use templates but i find this wasteful and not intuitive.
#3 when i leave this job, and my code remains behind, the new developer won't have a clue what all this crap is and how the directory structure works without really sitting down with it for a week or two. in my job, my projects are simple so it is my obligation to keep my code simple.
#1 the first problem is that smarty does not solve my dilemna. i wanted a simple way to make my code look cleaner. so what is a good solution for the lone programmer wishing to separate presentation from content?...
#2 smarty uses its own language in order to compile its templates into php code. each tag uses "{" and "}" which means that when including any javascript or other php functions, special tags such as {literal}, {php}, and {rdelim} and {ldelim} must be used. learning this is not a problem. the problem is that i have some pages which use a template and some that do not. both include the same file containing php functions. for the templated page, it wants {php} and the non-templated page wants < ? php. this means i cannot use the same include file for both. i guess the solution is that all the pages should use templates but i find this wasteful and not intuitive.
#3 when i leave this job, and my code remains behind, the new developer won't have a clue what all this crap is and how the directory structure works without really sitting down with it for a week or two. in my job, my projects are simple so it is my obligation to keep my code simple.
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home