SitePoint Sponsor

User Tag List

Page 3 of 4 FirstFirst 1234 LastLast
Results 51 to 75 of 80
  1. #51
    SitePoint Evangelist ghurtado's Avatar
    Join Date
    Sep 2003
    Location
    Wixom, Michigan
    Posts
    591
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    Such as this...??

    PHP Code:
    // from my short term memory...
    $this -> setAttribute'text'$this -> Context() -> Request() -> getParameter'text' ) ); 
    Yer, I kind of have to agree with you, it's just gone all crazy
    Blame whomever had the brilliant idea of borrowing the "arrow" operator from Perl for object references. That piece of code wouldn't look nearly as ugly written as:
    PHP Code:
    $this.setAttribute($this.context.request.getParameter('text')); 
    In fact, I'm sure many of you have done just as much chaining with Java, Ruby, Javascript or ASP.
    Garcia

  2. #52
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayboots
    To all you people saying "Smarty Sucks", do you care to mention why?
    Although i didn't say: "Smarty sucks",

    - Smarty can't do all the things php can do (some people might find that an argument in the advantage for smarty)

    - Smarty is slower than PHP. And it's yet another language we would need to learn. In that case i prefer to learn xsl, as it's usable in other environments too.

  3. #53
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    PHP Code:
    $this -> setAttribute'text'$this -> Context() -> Request() -> getParameter'text' ) ); 
    Yer, I kind of have to agree with you, it's just gone all crazy
    Yeah, that's just stupid. The good thing is that with PHP5, you can rig it like this:
    PHP Code:
    $this->text $this->context->request->text
    I'd like the instance.method-style as well, but we'd also have to change the concatenation operator.

    Is PHP going to support accessor methods any time soon? I mean in the sense that you could do $object->property = $foo; and it would trigger the setter method for property transparently, even if the property is public. Nowadays we have to fool around with __get() and __set() to achieve something similar, which isn't that great.

  4. #54
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayboots
    To all you people saying "Smarty Sucks", do you care to mention why?
    The whole concept of building a template language on top a template language (what PHP started as, and is still perfectly good at) is quite absurd. It adds a whole other layer to your application that just isn't nessecary. And what exactly makes Smarty's syntax so special that it is easier for non developers to learn compared to PHP? I agree it would be nice to place restrictions on what PHP functions can be used in templates, but I can live with trusting designers to do as their told.

  5. #55
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by ghurtado
    In fact, I'm sure many of you have done just as much chaining with Java, Ruby, Javascript or ASP.
    Quite, but why should it be nessecary to do something simple like setting a variable in the controller and accessing it in the view? Not wanting to start another PHP/Ruby/Rails debate, but give me this any day:

    Code:
    example_controller.rb
    ---
    class ExampleController < ApplicationController
        
        def index
            @myvar = "HELLO WORLD!"
        end
    
    end
    
    index.rhtml
    ---
    <h1>This is my example view</h1>
    
    <p><%= @myvar %></p>
    Over Agavi's endless context/request/blah blah anyday.

  6. #56
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Luke Redpath
    The whole concept of building a template language on top a template language (what PHP started as, and is still perfectly good at) is quite absurd. It adds a whole other layer to your application that just isn't nessecary. And what exactly makes Smarty's syntax so special that it is easier for non developers to learn compared to PHP? I agree it would be nice to place restrictions on what PHP functions can be used in templates, but I can live with trusting designers to do as their told.
    Hmm. That doesn't explain why Smarty "sucks", it only suggests why you choose not to use it. Personally, I think that it is absurd to have a trust relationship with the designer, particularly if you are allowing custom modifications from unknown sources. Other template solutions that use PHP as the template language have a huge problem with this (amongst other things).

    As to the whole PHP is a templating language argument -- that's baloney and a myth that is being popularized by some. It may have been true at around PHP3, but it certainly isn't now. If there really wasn't a need for less complex languages for specific tasks, we'd all be programming in C or ASM, not? The whole point is that nearly every knowledge domain worthy of discussion has a specific and unique dialect. Sure, you can address the problems in that domain with a GP language (or at least, GP scripting language) but that doesn't mean you can't do better with something geared specifically for that discipline. Smarty is far from perfect but unlike PHP, it isn't trying to do everyything -- it only wants to serve in a specific problem area and with a limited but uniform set of tools. Why does that suck?

  7. #57
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by timvw
    Although i didn't say: "Smarty sucks",

    - Smarty can't do all the things php can do (some people might find that an argument in the advantage for smarty)

    - Smarty is slower than PHP. And it's yet another language we would need to learn. In that case i prefer to learn xsl, as it's usable in other environments too.
    You are right, it is good that Smarty can't do all the things that PHP can do. That's a feature.

    Amazingly, XSLT is also slow and like Smarty, can not do everything that PHP can do. Furthermore, it is a functional language rather than imperative meaning that it tends to have a much higher learning curve (particular for non-coders) and tends to have more difficult maintence of user produced code. In general I'd say it is a terrible templating language because it doesn't lend itself to the way people think of templating. I say this having spent considerable time with XSLT trying to use it as a template solution.

  8. #58
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Amazingly, XSLT is also slow
    Not so with PHP5.x

    XSL-T can do everything that PHP can do, and it can do a lot more, considering that there is a clear and present separation between the two (the stylesheet)

    But I don't want to start an arguement about XSL-T <> PHP, or let this thread go off topic

  9. #59
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Back on topic: has anyone tried the ZNF framework ?

  10. #60
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    Not so with PHP5.x

    XSL-T can do everything that PHP can do, and it can do a lot more, considering that there is a clear and present separation between the two (the stylesheet)
    I want to hear more about this. A guide or thread somewhere?

    Edit:

    Searched the forum and found a few interesting threads. I have a few problems with this: creating the DOM and non-compileability. I guess it comes to down it being fast enough despite that, which you assure it is. I reckon creating something based on XML_Transform would allow creating xsl-like, compileable templates.

    XSL is also something to learn as a language. Can you use {/xpath} anywhere or just attributes? Any good learning resources? Re-edit: Eh. The entity issue sure is something. Is it slow importing the entities off the web somewhere, ie. is the result cached?
    Last edited by Ezku; Aug 8, 2005 at 14:12.

  11. #61
    SitePoint Addict timvw's Avatar
    Join Date
    Jan 2005
    Location
    Belgium
    Posts
    354
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayboots
    In general I'd say it is a terrible templating language because it doesn't lend itself to the way people think of templating. I say this having spent considerable time with XSLT trying to use it as a template solution.
    I must admit that it took a while to learn XSL before i could really use it any way i want to use it.

    But i've spend as much time to try and understand smarty but there was always something that kept me back from using it efficiently (Can't remember a specific issue right now)

  12. #62
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Any good learning resources?
    Take a (good) look at OReilly's Xml in a Nutshell, which is an excellent choice btw Chapter 9 I believe is available on-line as I post this in fact,

    http://www.oreilly.com/catalog/xmlnut/chapter/ch09.html

    Enjoy

  13. #63
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Dr Livingston
    XSL-T can do everything that PHP can do, and it can do a lot more, considering that there is a clear and present separation between the two (the stylesheet)
    Not so -- not that I think it is terribly important that a template solution do everything that PHP can. For example, you can't write to the filesystem with XSLT nor can you access a remote database to name but two. The worst thing is that very simple things can often be rather complicated with XSLT. For example, generate an A-Z TOC with topics in XSLT -- the solution is not obvious or trivial, even though it is precisely the type of thing that ought to be.

  14. #64
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    Quote Originally Posted by Ezku
    Eh. The entity issue sure is something.
    I still can't get it right. No matter what I do, it's Entity 'copy' not defined. Why won't this work?
    Code:
    <!DOCTYPE html SYSTEM "http://www.w3.org/2003/entities/xhtml1/xhtml1-lat1.ent">

  15. #65
    throw me a bone ... now bonefry's Avatar
    Join Date
    Nov 2004
    Location
    Romania
    Posts
    848
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayboots
    Not so -- not that I think it is terribly important that a template solution do everything that PHP can. For example, you can't write to the filesystem with XSLT nor can you access a remote database to name but two. The worst thing is that very simple things can often be rather complicated with XSLT. For example, generate an A-Z TOC with topics in XSLT -- the solution is not obvious or trivial, even though it is precisely the type of thing that ought to be.
    An A-Z TOC is pretty easy to me. Also, of course you cannot compare PHP ( a program language ) with XSL ( the Extensible Style Language ).

    The main advantage of XSL over PHP when talking strictly about templates is that XSL is a standard. And thus, there are good tools for it. And you theoreticaly can render a XSL+XML sollution in any platform and also in any modern browser.

  16. #66
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    An A-Z TOC is pretty easy to me. Also, of course you cannot compare PHP ( a program language ) with XSL ( the Extensible Style Language ).

    The main advantage of XSL over PHP when talking strictly about templates is that XSL is a standard. And thus, there are good tools for it. And you theoreticaly can render a XSL+XML sollution in any platform and also in any modern browser.
    Are you a typical template user/writer? I didn't say it wasn't easy for me either but I have a background in CS.

    The fact that the W3C declared XSLT a standard does not in itself make it a good solution. Indeed, what you can theorertically do with XSLT doesn't quite meet the reality of what is actually possible and completely portable. In many ways it is an ill-conceived technology.

  17. #67
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by bonefry
    An A-Z TOC is pretty easy to me.
    Yeah. If it's so hard there must be something wrong with doing the obvious:
    Code:
    <ol>
    <xsl:for-each select="items/item">
       <xsl:sort select="topic"/>
       <li><xsl:value-of select="topic" /></li>
    </xsl:for-each>
    </ol>

  18. #68
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Ezku: now do it with A-Z headers like a standard table of contents.

  19. #69
    SitePoint Guru
    Join Date
    May 2005
    Location
    Finland
    Posts
    608
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayboots
    @Ezku: now do it with A-Z headers like a standard table of contents.
    Oh. I'd say I can't do it, not without reading a heap of tutorials first. But when was that ever easy with a mere template anyway?

    Anyone have a solution for the entities problem? I managed to get rid of the error messages using this
    Code:
    <!DOCTYPE xsl:stylesheet [
    	<!ENTITY % xhtml-lat1 SYSTEM "http://www.w3.org/2003/entities/xhtml1/xhtml1-lat1.ent">
    	%xhtml-lat1;
    ]>
    but there still aren't any entities in the output. What's that all about? (And oh, yes, it's abysmally slow - you absolutely need to have a local copy.)

    Might I say that this is one good reason not to use XSLT. There's a lot of stuff that needs to be found out - and I can't find anywhere that says what to do. Hey, newbie, want to use an XHTML entity in your template? You're ****ed. Thanks for visiting.
    Last edited by Ezku; Aug 8, 2005 at 16:08.

  20. #70
    SitePoint Member
    Join Date
    Jun 2005
    Posts
    9
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Off topic posts

    This thread has reached about 70 posts, but about 50 are off-topic, typically religion wars about which templating technology is better. We're searching for comments about our framework from people with good knowledge of PHP5 and design patterns and we think that this could be the right place, so I will appreciate if someone here would take a deeper look on ZNF, it's implementation and it's documentation and give us real feedbacks rather than continue flaming.
    Don't mind to join mailing lists if you have good proposals or big feedbacks for us.

    Tnx in advance.

  21. #71
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The main advantage of XSL over PHP when talking strictly about templates is that XSL is a standard. And thus, there are good tools for it. And you theoreticaly can render a XSL+XML sollution in any platform and also in any modern browser.
    This is just the point I was trying to make

    The fact that the W3C declared XSLT a standard does not in itself make it a good solution.
    The fact that it is a standard, does actually in fact make it a good solution. Why is it a good solution? Because any number of businesses in any number of industries put their weight behind it.

    Microsoft for one, but there are many, many others. You just cannot ignore the influence that they have on the smaller businesses that use Microsoft technology and software.

    Indeed, what you can theorertically do with XSLT doesn't quite meet the reality of what is actually possible and completely portable.
    XSL-T is completely portable, if you have an stylesheet developed for PHP, you can take that exact stylesheet (without modifications), and use it with Dot Net, Java, etc to transform a given document the stylesheet was intended for.

    Just how is that not portable huh?

    In many ways it is an ill-conceived technology.
    That is an ill thought out comment to make, and is very stupid and distruptive. I get the feeling that you have made that comment as it's [XSL-T] a technology that you don't yet fully understand, nor yet taken the full advantage of what it can do.

    You should not dismiss it so easily. If you are having trouble learning the technology, that is one thing, but it's a problem you have with the technology... That's not to say the next person who comes along, will not find the technology easy to learn and use.

    We all have differing learning levels

  22. #72
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayboots
    Hmm. That doesn't explain why Smarty "sucks", it only suggests why you choose not to use it. Personally, I think that it is absurd to have a trust relationship with the designer, particularly if you are allowing custom modifications from unknown sources. Other template solutions that use PHP as the template language have a huge problem with this (amongst other things).

    As to the whole PHP is a templating language argument -- that's baloney and a myth that is being popularized by some. It may have been true at around PHP3, but it certainly isn't now. If there really wasn't a need for less complex languages for specific tasks, we'd all be programming in C or ASM, not? The whole point is that nearly every knowledge domain worthy of discussion has a specific and unique dialect. Sure, you can address the problems in that domain with a GP language (or at least, GP scripting language) but that doesn't mean you can't do better with something geared specifically for that discipline. Smarty is far from perfect but unlike PHP, it isn't trying to do everyything -- it only wants to serve in a specific problem area and with a limited but uniform set of tools. Why does that suck?
    My point is that PHP started life as a templating language. Just because it has evolved since then, why should that preclude it still being used for what it was originally designed to do?

    Why is it absurd to trust a colleague as well? Are we all really paranoid of our designers trying to deliberately break our websites/applications? I'd suspect designers who did that wouldn't be in work very long. It's about respect and trust between two professionals.

  23. #73
    SitePoint Guru silver trophy Luke Redpath's Avatar
    Join Date
    Mar 2003
    Location
    London
    Posts
    794
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by jayboots
    Smarty is far from perfect but unlike PHP, it isn't trying to do everyything -- it only wants to serve in a specific problem area and with a limited but uniform set of tools. Why does that suck?
    Because it adds a completely unnessecary layer on top of your application, adds a new dependency, and is yet another language to learn, when PHP does the job just fine. Why do people have this need to make their apps more complicated and layered than they really need to be?

  24. #74
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    Toronto
    Posts
    300
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    @Dr. Livingston:

    Sorry, standards can be broken too, or worse, set about and ratified only to fulfill a political agenda (in this case, the proliferation of XML) rather than satisfying a truly technical need. If XSLT meets your needs, that is great -- but in truth I'm not particularly interested in discussing the merits or pitfalls of XSLT mainly because I'm no longer interested in XSLT after having extensive exposure to it. Who knows -- maybe one day you will reach your tolerance level and think it is broken too?

    The reason I posted into this thread was to ask why comments saying "Smarty sucks" were being made without giving further comment. FWIW, I found it strange that you would let those sorts of comments slide yet when I more simply said that XSLT was ill-conceived, you called me out (or at least my comments) as being "very stupid and distruptive". Tsk tsk. Please don't take my comments personally -- its just technology and code and I'm qualified enough to be able to say that something is great or not just as I'm sure you are qualified enough to agree or disagree with my opinions. On-the-other-hand, I'm sure we can all live without the personal disparagements.

    In respect of aronnax's comments I will drop this even though it does seem to be in scope since ZNF supports both technologies.

    Greetings.

  25. #75
    Non-Member
    Join Date
    Jan 2003
    Posts
    5,748
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Off Topic:

    I never said your stupid, but I said your commenting was stupid, but I should have been more clearer, since it could be seen as I was saying your stupid, in a personal manner

    I still don't understand your reluctance for XSL-T but I too have had a lot of exposure to XSL-T myself, and much like PHP, I'm an advocate to XML and it's technologies too

    On-the-other-hand, I'm sure we can all live without the personal disparagements.
    Sorry about the reply that I made, I wasn't being personal and hope you accept my apology?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •