tj71587 Posted October 25, 2007 Share Posted October 25, 2007 I have been coding jsp for work alot and they have a tag library, making jsp easier and cleaner. An example of what I mean is for an if statement instead of going into the jsp makers <% %> and programming the if it is a <c:if test="${param}"></c:if>. I've been looking for a tag library with php but havent found one, and my last shot was asking on this board. Does anyone know anything about this as far as it being available or does anyone know if this is an in demand idea currently in development, or is just me wishfully thinking? Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/ Share on other sites More sharing options...
kratsg Posted October 25, 2007 Share Posted October 25, 2007 To me, it sounds a little like Smarty o_o I mean, smarty shortens php coding with template management, but php itself is short. The if/else can be shortened in php: ($username != null ? $username : "Sorry, you didn't type in anything for your name." ); //equivalent if($username != null){ echo $username; } else { echo "Sorry, you didn't type in anything for your name."; } Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-377474 Share on other sites More sharing options...
tj71587 Posted October 25, 2007 Author Share Posted October 25, 2007 I gotcha, but theres nothing that makes php into something along the lines of simple html start and end tags. Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-377483 Share on other sites More sharing options...
SammyGunnz Posted October 25, 2007 Share Posted October 25, 2007 You really don't want that. My personal belief is that it doesn't do much for someone learning PHP and would lead to bad coding practices. Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-377486 Share on other sites More sharing options...
tj71587 Posted October 25, 2007 Author Share Posted October 25, 2007 Yes and no, doing it the traditional programming way takes a better programmer and probably encourages better habits, however it is also easier to read and maintain with tags, it keeps everything cleaner, in my opinion atleast. Using jsp both ways, the tags seem to make everything easier to read and edit. Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-377488 Share on other sites More sharing options...
kratsg Posted October 25, 2007 Share Posted October 25, 2007 I do agree, about the if/else statements. I usually prefer writing it out with the { } and ( ) as it's "good practice". You would have to understand that functions are pretty much shortened PHP codes for certain things. I do belive Smarty is somewhat along the lines of what you're looking for. Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-377490 Share on other sites More sharing options...
tj71587 Posted October 25, 2007 Author Share Posted October 25, 2007 Something like that will do, though I was kinda hoping for tags but thanks for help guys. Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-377495 Share on other sites More sharing options...
gord Posted October 5, 2009 Share Posted October 5, 2009 Hi, I use this tag library for my own startup hacking and professional PHP gigs, so you may find it useful. Basically it mimics the style of nice approaches Ive seen in plt scheme and arc lisp - highly nested, self closing tags, build up structures, easy droplists etc.. Article here - http://quantblog.wordpress.com/2009/10/01/xilla_tags-php-library-make-html-with-lispy-php-code/ Download here - http://code.google.com/p/xillatags/downloads/list Basically to make a table you go like this - table("", tr("", array( td("", "item one"), td("", "item two")))); BSD licence, enjoy, gord webxilla.com Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-931043 Share on other sites More sharing options...
Maq Posted October 5, 2009 Share Posted October 5, 2009 I think it's great that you posted a potential solution that others can reference, but you do know this thread is from almost 2 years ago? Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-931063 Share on other sites More sharing options...
Zane Posted October 5, 2009 Share Posted October 5, 2009 damnit!.. I knew there was no point in reading this. Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-931073 Share on other sites More sharing options...
Maq Posted October 5, 2009 Share Posted October 5, 2009 damnit!.. I knew there was no point in reading this. Hahaha, you don't look at the dates either!? Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-931078 Share on other sites More sharing options...
kratsg Posted October 6, 2009 Share Posted October 6, 2009 What the hell guys? >.> It's not like the dates are that hard to find... not particularly. Quote Link to comment https://forums.phpfreaks.com/topic/74672-tag-library/#findComment-931834 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.