Re: Re: More thoughts about PHP: Taglibs

From: Date: Tue, 11 Sep 2001 15:14:30 +0000
Subject: Re: Re: More thoughts about PHP: Taglibs
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-66932@lists.php.net to get a copy of this message
Perhaps you should just use cold fusion then, if you're that hot and heavy into tag-based languages. tagservlet.com has a Java/CF hybrid which may hold some interest. PHP's strength, IMO, is that it's NOT a tag-based language. You can create any functions you want and call them already from a <? ?> combination <?=myFunction($params);?> Separating code/content is a much stronger idea, with just variable replacements in the 'template'. In the examples below, how do you gracefully handle errors? You don't - not without addding more code to the file. Or look more into XML/XSLT stuff. nicolas costes wrote:
maybe one day, PHP will implement user defined tags .... this could be an idea, if this is prooved to be useful.
   (°-        Nayco,
   //\        Nayco@netcourrier.com
   v_/_     http://nayco.free.fr
ORIGINAL MESSAGE---------------------------------------------> Yep this is not bad!
<html> Hello, <showusername/>. Your last login was <showlastlogin/>.<p> </html>
and now using PHP's short tags, you can make it even prettier: <html> Hello, <?=showusername()?>. Your last login was <?=showlastlogin()?>.<p> </html> Right? "Dr. Evil" <drevil@sidereal.kz> wrote in message news:20010911050455.12049.qmail@sidereal.kz...
It seems to me that one of the problems with PHP is that you have to include code in your HTML pages. Even with the cleanest design, you end up with HTML that looks like this: <html> Hello, <?php showusername(); ?>. Your last login was <?php showlastlogin(); ?>.<p> </html> This is ok, but it seems to me that java taglibs provide a more elegant way to do the same things: <html> Hello, <showusername/>. Your last login was <showlastlogin/>.<p> </html> This lets the backend stuff be completely separated from the html design part of things. What do people think of this? I'm just now learning JSP so I'm thinking about the differences between PHP and JSP. In general, both are powerful ways of creating dynamic websites, but they have different characteristics and are better for different things. I'm learning java but I will continue to use both, depending on the task.


« previous php.general (#66932) next »