NYCPHP Meetup

NYPHP.org

[nycphp-talk] Parsing <php: possible?

Daniel Krook krook at us.ibm.com
Mon Jul 19 12:26:40 EDT 2004


> These example are a bite off ATG Dynamo JHTML/droplet stuff but what
> Im really after is the including files w/ params stuff from a tag
> based structure.  Im sure this either a) exists in some form somewhere
> b) can be done or c) no worth it.  Any thoughts?


Jon,

I see where you're going with this, you basically want to emulate a 
templating system which uses a system like Java's taglibs or, prior to 
that, ATG Dynamo's JHTML, so as to shield your presentation layer 
developers from business logic.  In particular you want to be able to 
create a bean (or the result of an included function) for use on the page. 
 For example, getting a user bean from the following type of tag:

<php:importbean type="user" src="inc/classes/User.php"
<php:bean name="currUser" type="user">
        <php:param name="id" value="34"/>
</php:bean> 

...

<php:valueof param="currUser.firstname"/> 


This type of approach is interesting, and I've never seen anyone try it 
[answer "a"], but there are other ways (like you mentioned, Smarty) to 
accomplish a similar goal [answer "b"]:

"A Tale of Three [Four] Templates"
http://nyphp.org/content/presentations/3templates/


But I tend to argue against it for several reasons... [answer "c"]

"Tag-based server-side code is for goobers."
http://lists.nyphp.org/pipermail/dev/2003-October/001393.html








Daniel Krook, Application Developer
WW Web Production Services North 2, ibm.com
1133 Westchester Avenue, White Plains, NY 10604

Personal: http://info.krook.org/
Persona: http://w3.ibm.com/eworkplace/persona_bp_finder.jsp?CNUM=9A9796897



More information about the talk mailing list