|
Posted by Rory Browne on 05/10/05 14:46
> This has all been done before, and in a number of ways. If you really
> *must* build your own templating class, go and thoroughly review the
> code of those that already exist: Smarty, Savant, paTemplate,
> FastTemplate, etc. Figure out how each solved the problems. Then
> determine if you can improve upon their solutions.
This has all been done before, and I'm assuming that the James knows,
and has seen that before, since he used the same common method names,
as is in many php templating systems. $class->assign has been used in
any templating system I've ever seen(although to be honest I haven't
seen that many).
I don't think the fact that it has been done before should inhibit him
from doing it again. Carrying out the process, is one of the most
educational ways, and perhaps one of the most enlightening ways to see
how a process works.
I'm not sure how many lines of code are in Savant, paTemplate, or
FastTemplate, etc, but smarty has way too many to be used as a
learning tool, and there are times, when you want raw speed, that can
only be delivered via minimal, specialist code. Smarty is also too
complicated to be used by someone without good knowledge of
templating, and one of the best ways to understand it is to write your
own IMHO.
I think this question, whilst centred around templating, offers
opportunities for topics that aren't directly related to templating,
and perhaps PHP Programming in General. One particular area of
potential interest is dynamic code generation.
>
> --
> Matthew Weier O'Phinney | WEBSITES:
> Webmaster and IT Specialist | http://www.garden.org
> National Gardening Association | http://www.kidsgardening.com
> 802-863-5251 x156 | http://nationalgardenmonth.org
> mailto:matthew@garden.org | http://vermontbotanical.org
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>
[Back to original message]
|