The Daily WTF: Curious Perversions in Information Technology
Welcome to TDWTF Forums Sign in | Join | Help
in Search

That's what SMARTY were designed for...

Last post 07-17-2008 1:13 AM by ammoQ. 82 replies.
Page 1 of 2 (83 items) 1 2 Next >
Sort Posts: Previous Next
  • 07-14-2008 6:26 PM

    That's what SMARTY were designed for...

    Locked Reply Contact

    I've been recently fixing a cms written in PHP using SMARTY tpl's... well, it was one of the requirments to do so. I fixed few bugs, and started checking for optimization, and I've found that page template looks like these:

    {$page_text}

     The whole content was generated using PHP, and SMARTY... well, they wanted them, so here they are, with their whole functionality ;)

  • 07-14-2008 6:38 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

     TRWTF is Smarty.  Why do we need a template language for PHP which is itself a template language?  Fuck it.

  • 07-14-2008 9:31 PM In reply to

    • Weng
    • Top 50 Contributor
    • Joined on 03-14-2008
    • Posts 506

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    morbiuswilters:

     TRWTF is Smarty.  Why do we need a template language for PHP which is itself a template language?  Fuck it.

     

     Because useless wanker web devs can't figure out how to not break PHP.

  • 07-15-2008 2:44 AM In reply to

    • stratos
    • Top 50 Contributor
    • Joined on 09-06-2006
    • Zeeland, Netherlands
    • Posts 536

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    Weng:

     Because useless wanker web devs can't figure out how to not break PHP.



    And how do you "break" PHP? If you acctually meant breaking the application then i'm afraid smarty isn't going to help you.

    My web-consulting company - My web development blog - "Show me a sane man and I will cure him for you." - C. G. Jung
  • 07-15-2008 4:09 AM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    stratos:
    Weng:
     Because useless wanker web devs can't figure out how to not break PHP.
    And how do you "break" PHP? If you actually meant breaking the application then i'm afraid smarty isn't going to help you.
     

    Maybe he means graphics designers? In my personal experience the vast majority of their expertise lies in using Dreamweaver and the like. Asking them to add their HTML to the PHP framework is usually like giving a 7 year old gunpowder and telling him to build his own fireworks. Even if he can figure it out, it will most likely end in tears.

    Unfortunately I have yet to meet a graphics designer that's interested in learning to use a template system, Smarty or otherwise. Their philosophy is usually "If I can't drag-n-drop, I aint using it".

    As for the OP... I hope they don't ask you to update the HTML.

  • 07-15-2008 5:19 AM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    My philosophy is "if you can't do html and css by hand, I am not working with you".
  • 07-15-2008 5:28 AM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

     Slightly side-tracking a bit, you just reminded me of the time I got called out- to remove a smarty from a USB socket. It's amazing what you find in there sometimes. I was so gobsmacked (This was an adult shop) that I took a picture- I'll have to go find it!

  • 07-15-2008 6:25 AM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:

    Maybe he means graphics designers? In my personal experience the vast majority of their expertise lies in using Dreamweaver and the like. Asking them to add their HTML to the PHP framework is usually like giving a 7 year old gunpowder and telling him to build his own fireworks. Even if he can figure it out, it will most likely end in tears.

    Unfortunately I have yet to meet a graphics designer that's interested in learning to use a template system, Smarty or otherwise. Their philosophy is usually "If I can't drag-n-drop, I aint using it".

    The one who should be electroshocked here is the person who asks a graphic designer to do any development at all. They are graphic designers. Not developers. A graphic designer -by definition- cannot do development, and a software developer cannot do graphic design. That's the whole point of specialization. It is just unfair to expect people to do stuff they are not trained to or don't have the affinity to do. Personally, I never will be able to sell cars, neither to catch criminals, nor to design graphics. That's because software development is my profession and I suck at everything else, including Photoshop, Dreamweaver and the rest.

    To be honest, I am sick of the arrogant elitist mentality of "everybody else is stupid" in the IT/Software Development Industry. It is really unprofessional and should be grown out already.

    The good doctor is here to help. I promise this time I will not screw up the operation.
  • 07-15-2008 7:32 AM In reply to

    • Daid
    • Top 75 Contributor
    • Joined on 01-30-2007
    • Posts 348

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    DrJokepu:
    To be honest, I am sick of the arrogant elitist mentality of "everybody else is stupid" in the IT/Software Development Industry. It is really unprofessional and should be grown out already.
    Yeah. But the question then remains... I got these fancy graphics here, and this nicely stable website that works great. Who is going to put them in the same jar and stir till it's one?

    The "I do software development, nothing else" mentality is also stupid. Someone has to put it all together. I've been a solo coder in a UT2004 mod (as hobby project), and while we had a few graphic artists, some modelers and a few people that build maps. I was the one that had to put it all together, rescaling models, fixing animations, exporting files to the right formats, fixing up maps, and tieing it all together in a final installer. In the end I had a 3D Studio Max, Photoshop and UnrealEd open, next to my coding tools (a text editor). Unless someone is getting out of that little box, you'll never get anywhere. Of course I'll never become a real artist, but I surely know the tools of the rest of the team.
  • 07-15-2008 7:43 AM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DrJokepu:
    The one who should be electroshocked here is the person who asks a graphic designer to do any development at all. They are graphic designers. Not developers. A graphic designer -by definition- cannot do development, and a software developer cannot do graphic design. That's the whole point of specialization. It is just unfair to expect people to do stuff they are not trained to or don't have the affinity to do.
    Sounds good in theory, but in a project where a developer builds the code and the graphics designer does the HTML/CSS someone had to do the integration at the end. And when the graphics change and the graphics designer produces a new batch of HTML/CSS someone has to do it all over again. In practice it's the developer that has to do this mind-numbing grunt work. Which is why people have come up with template systems like Smarty.  And let's face it, using the HTML side of Smarty is not exactly rocket science. We're not asking graphics designers to track down a memory leak here.

    Even if it were unfair to ask graphics designers to use a template system, it's definately not as unfair as having a developer do cut-and-paste HTML grunt work. I don't see why both parties can't agree to use a template system and meet in the middle. 

  • 07-15-2008 8:47 AM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    Speaking of graphic designers, the one who works for my company had a real hard time learning PHP, and by learning, I mean learning about includes. She still often creates header.inc files (which can typically just be opened like text files across the web) and tons of other files. It's still an improvement when she first started working for me and was putting ASP in all of the files. I forgive all of this because she makes wonderful designs and templates.
  • 07-15-2008 9:21 AM In reply to

    • stratos
    • Top 50 Contributor
    • Joined on 09-06-2006
    • Zeeland, Netherlands
    • Posts 536

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    urmmm, like someone already said. smarty is a tempalte language, and HEY what do you know, PHP is also a template language.

    <? FOREACH ( $items as $item): ?>

    <? IF ($item['special'] == true): ?>  special <? ENDIF; ?>

    <? ENDFOREACH; ?>

    vs.

    {foreach from=$items item=item}

    {if ($item.special == true) }  special {/if}

    {/foreach}

     

    No really what a big difference.

    My web-consulting company - My web development blog - "Show me a sane man and I will cure him for you." - C. G. Jung
  • 07-15-2008 9:59 AM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    stratos:
    urmmm, like someone already said. smarty is a tempalte language, and HEY what do you know, PHP is also a template language.
    I don't understand. Do we have something better than Smarty and like for the separation of PHP from HTML/CSS in a way that can be maintained without the developer having to muck about with HTML/CSS?

  • 07-15-2008 10:13 AM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

     Dear Sir,

    I have be the requirement to write a Web 2.0 website in AJAX, SMARTY, PHP and CSV. SNARTY  says

    Smarty error: problem creating directory "templates_c/239/239105369"

    Smarty error: problem creating directory "templates_c/239/239105369"

    Smarty error: problem creating directory "templates_c/239/239105369"

    Could you tell me what the problem is? Please send me your code to hkhan@yahoo.co.in

    The good doctor is here to help. I promise this time I will not screw up the operation.
  • 07-15-2008 10:29 AM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:
    I don't understand. Do we have something better than Smarty and like for the separation of PHP from HTML/CSS in a way that can be maintained without the developer having to muck about with HTML/CSS?

    Just use PHP.  Seriously, Smarty is just a slightly modified and weaker PHP syntax.  Your templates should mostly be HTML, CSS and JS anyway, with some variables pulled in and maybe a little bit of conditional logic or looping.  This is what Smarty does.  This is also what PHP does.  Why would you install a separate application to essentially emulate PHP-lite on top of PHP?

  • 07-15-2008 10:54 AM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

     

    morbiuswilters:
    Just use PHP.  Seriously, Smarty is just a slightly modified and weaker PHP syntax.  Your templates should mostly be HTML, CSS and JS anyway, with some variables pulled in and maybe a little bit of conditional logic or looping.  This is what Smarty does.  This is also what PHP does.  Why would you install a separate application to essentially emulate PHP-lite on top of PHP?
    Ah, I see. Well, assuming we have a graphics designer that would add his own stuff, I'd have to go with a template system because of the greater separation of presentation from code. Template systems tend to keep presentation in separate files which is good for graphics designers whose eyes understandably glaze over when confronted with the usual spaghetti of code and presentation you'd find a single PHP file (we're talking heavy-duty admin pages and the like here). Not only that but the more you have to deal with internationalization the more handy a template system becomes.

    That said, if I could find a graphics designer that's unfazed by the prospect of manouvering through code to make his changes (and can do so without messing up the code) I'd be more than happy to forego the template system and let him have a go at the .php files.

  • 07-15-2008 11:31 AM In reply to

    • stratos
    • Top 50 Contributor
    • Joined on 09-06-2006
    • Zeeland, Netherlands
    • Posts 536

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

     Ummm, so you need a third party application to put your presentation code into another file?

    My web-consulting company - My web development blog - "Show me a sane man and I will cure him for you." - C. G. Jung
  • 07-15-2008 11:38 AM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:

    Ah, I see. Well, assuming we have a graphics designer that would add his own stuff, I'd have to go with a template system because of the greater separation of presentation from code. Template systems tend to keep presentation in separate files which is good for graphics designers whose eyes understandably glaze over when confronted with the usual spaghetti of code and presentation you'd find a single PHP file (we're talking heavy-duty admin pages and the like here). Not only that but the more you have to deal with internationalization the more handy a template system becomes.

    That said, if I could find a graphics designer that's unfazed by the prospect of manouvering through code to make his changes (and can do so without messing up the code) I'd be more than happy to forego the template system and let him have a go at the .php files.

    Seriously, what the hell are you talking about?  PHP is a templating language, in addition to many other things.  If your pages are spaghetti logic all crammed into one file, that is your fault.  Ideally you would have PHP template files with well-constructed business objects kept completely separate.  There is no need for Smarty to accomplish this.

  • 07-15-2008 1:13 PM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    morbiuswilters:
    Ideally you would have PHP template files with well-constructed business objects kept completely separate. There is no need for Smarty to accomplish this.
    If like you said I'm going to have a separation of logic and presentation then someone has to build that architecture. Why would I opt for the not-invented-here option by building my own when an existing template system like Smarty can do it for me?

  • 07-15-2008 1:20 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:
    Why would I opt for the not-invented-here option by building my own when an existing template system like Smarty can do it for me?

    Why would I opt for the not-invented-here option by building my own when an existing template system like PHP can do it for me?

    The good doctor is here to help. I promise this time I will not screw up the operation.
  • 07-15-2008 1:24 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    DOA:
    If like you said I'm going to have a separation of logic and presentation then someone has to build that architecture.
    Right, the PHP developers.
    DOA:
    Why would I opt for the not-invented-here option by building my own when an existing template system like Smarty can do it for me?
    WTF? Do you think Smarty is going to write your web app for you?
  • 07-15-2008 1:30 PM In reply to

    • stratos
    • Top 50 Contributor
    • Joined on 09-06-2006
    • Zeeland, Netherlands
    • Posts 536

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:

    morbiuswilters:
    Ideally you would have PHP template files with well-constructed business objects kept completely separate. There is no need for Smarty to accomplish this.
    If like you said I'm going to have a separation of logic and presentation then someone has to build that architecture. Why would I opt for the not-invented-here option by building my own when an existing template system like Smarty can do it for me?

     

    If you want a framework, use a framework. There are plenty to choose from. Some use smarty, some don't. 

    But using smarty because its "easier for designers" is just bullshit.
    My web-consulting company - My web development blog - "Show me a sane man and I will cure him for you." - C. G. Jung
  • 07-15-2008 1:42 PM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    bstorer:
    DOA:
    If like you said I'm going to have a separation of logic and presentation then someone has to build that architecture.
    Right, the PHP developers.
    Only a complete novice would write from scratch something he can get from a proven existing library. Try and educate yourself on good programming practices.
    bstorer:
    DOA:
    Why would I opt for the not-invented-here option by building my own when an existing template system like Smarty can do it for me?
    WTF? Do you think Smarty is going to write your web app for you?
    Are you on drugs? Which part of using Smarty for a webpage's templating needs didn't you understand?

    stratos:
    But using smarty because its "easier for designers" is just bullshit.
    It's easy to brand someone's suggestion as "bullshit" without offering an alternative. How do you think it should be done to be easier for designers?

  • 07-15-2008 1:48 PM In reply to

    • stratos
    • Top 50 Contributor
    • Joined on 09-06-2006
    • Zeeland, Netherlands
    • Posts 536

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:
    stratos:
    But using smarty because its "easier for designers" is just bullshit.
    It's easy to brand someone's suggestion as "bullshit" without offering an alternative. How do you think it should be done to be easier for designers?
     

    stratos:

    urmmm, like someone already said. smarty is a template language, and HEY what do you know, PHP is also a template language.

    <? FOREACH ( $items as $item): ?>

    <? IF ($item['special'] == true): ?>  special <? ENDIF; ?>

    <? ENDFOREACH; ?>

    vs.

    {foreach from=$items item=item}

    {if ($item.special == true) }  special {/if}

    {/foreach}

     

    No really what a big difference.


     

    My web-consulting company - My web development blog - "Show me a sane man and I will cure him for you." - C. G. Jung
  • 07-15-2008 1:57 PM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    stratos:

    urmmm, like someone already said. smarty is a template language, and HEY what do you know, PHP is also a template language.

    <snip>

    No really what a big difference.

    I don't understand. Your solution is using PHP code instead of the tags of a template system? How does that make a difference to a graphics designer?

  • 07-15-2008 2:13 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

     Ok this thread is starting to be a little bit redundant, so here is what my current company does. Although my company doesn't do PHP (we're an ASP.NET shop) we face similar problems. Our solution is that the HTML/webdesign/graphic design wizards do the HTML and then the developers wire it up with aspx functionality. Here is the rationale behind that: the "wiring up" part can be quite complicated in some cases, so that's something that should be done by a developer, no matter how boring or tedious the task is.

    The good doctor is here to help. I promise this time I will not screw up the operation.
  • 07-15-2008 2:19 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    DOA:
    Only a complete novice would write from scratch something he can get from a proven existing library. Try and educate yourself on good programming practices.
    I'm quite aware of good programming practices. Perhaps you should avail yourself of some basic good practices, regardless of the field. Why the fuck would you suggest adding a template language to... A TEMPLATE LANGUAGE.
    DOA:
    Are you on drugs? Which part of using Smarty for a webpage's templating needs didn't you understand?
    I must be on drugs, because that's the only explanation for why I'm still trying to get it through your thick skull that PHP already does templating. What killer feature does Smarty offer that isn't already simple to template in stand-alone PHP?
  • 07-15-2008 2:20 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    DOA:

    stratos:

    urmmm, like someone already said. smarty is a template language, and HEY what do you know, PHP is also a template language.

    <snip>

    No really what a big difference.

    I don't understand. Your solution is using PHP code instead of the tags of a template system? How does that make a difference to a graphics designer?

    Exactly. It's just as easy, and doesn't require piling on an extra framework.
  • 07-15-2008 2:33 PM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    bstorer:
    Exactly. It's just as easy, and doesn't require piling on an extra framework.
    You think that because you clearly have never tried to separate content from logic in anything more complicated than a PHP form. Not to mention how laughable such a claim is if you have to deal with internationalization and localization.

  • 07-15-2008 2:41 PM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    bstorer:
    I'm quite aware of good programming practices. Perhaps you should avail yourself of some basic good practices, regardless of the field. Why the fuck would you suggest adding a template language to... A TEMPLATE LANGUAGE.I must be on drugs, because that's the only explanation for why I'm still trying to get it through your thick skull that PHP already does templating. What killer feature does Smarty offer that isn't already simple to template in stand-alone PHP?
     PHP is a programming language. Smarty is a template engine. Please tell me that you understand the difference.
    bstorer:
    What killer feature does Smarty offer that isn't already simple to template in stand-alone PHP?
    Are you serious? You've never used a template engine with PHP, have you?

  • 07-15-2008 2:41 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:

    bstorer:
    Exactly. It's just as easy, and doesn't require piling on an extra framework.
    You think that because you clearly have never tried to separate content from logic in anything more complicated than a PHP form. Not to mention how laughable such a claim is if you have to deal with internationalization and localization.

    This is absurd.  Smarty is no easier for people to work with than templated PHP.  You don't need any "magic" to use PHP as you would smarty, it's just good practice.  Your logic and your display should be separate.  Smarty does nothing to make this easier than PHP already does.  If you can't seem to write an app without churning out all-in-one-script PHP spaghetti code the solution isn't to use Smarty, it's for you to learn how to program properly before you propagate any additional WTFs.

  • 07-15-2008 2:42 PM In reply to

    • stratos
    • Top 50 Contributor
    • Joined on 09-06-2006
    • Zeeland, Netherlands
    • Posts 536

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:

    bstorer:
    Exactly. It's just as easy, and doesn't require piling on an extra framework.
    You think that because you clearly have never tried to separate content from logic in anything more complicated than a PHP form. Not to mention how laughable such a claim is if you have to deal with internationalization and localization.

     

    Oh please great DOA, enlighten us how smarty does a better job at internationalisation. 

     

    My web-consulting company - My web development blog - "Show me a sane man and I will cure him for you." - C. G. Jung
  • 07-15-2008 2:54 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    DOA:

    bstorer:
    Exactly. It's just as easy, and doesn't require piling on an extra framework.
    You think that because you clearly have never tried to separate content from logic in anything more complicated than a PHP form. Not to mention how laughable such a claim is if you have to deal with internationalization and localization.

    Just because you can't figure out how to write a PHP page with proper separation of business logic from display logic doesn't mean that good developers can't. I'd take a moment to reassess my abilities if I were you.
  • 07-15-2008 3:01 PM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    morbiuswilters:
    Smarty is no easier for people to work with than templated PHP.  You don't need any "magic" to use PHP as you would smarty, it's just good practice.  Your logic and your display should be separate.  Smarty does nothing to make this easier than PHP already does.  If you can't seem to write an app without churning out all-in-one-script PHP spaghetti code the solution isn't to use Smarty, it's for you to learn how to program properly before you propagate any additional WTFs.
    I don't understand why everyone's comparing PHP with Smarty. One's a programming language, the other a template engine.

    FACT: For anything above kindergarten level you can't get away with "<php code><my human readable text here><php code>". It. Just. Doesn't. Work. To find out why you need only try it out for yourself.

    So you need some sort of template engine. Which leaves us with rolling your own (see not invented here syndrome) or use an existing one.

    stratos:
    Oh please great DOA, enlighten us how smarty does a better job at internationalisation.
    You need only use a template engine for yourself.

    bstorer:
    Just because you can't figure out how to write a PHP page with proper separation of business logic from display logic doesn't mean that good developers can't. I'd take a moment to reassess my abilities if I were you.
    That's funny coming from someone who can't even tell the difference between a language and a template engine.

  • 07-15-2008 3:08 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    DOA:
    FACT: For anything above kindergarten level you can't get away with "<php code><my human readable text here><php code>". It. Just. Doesn't. Work. To find out why you need only try it out for yourself.
    Again, your actual business logic should not be mixed with HTML. This is extremely basic. That little bit of logic you do need for, say, building tables and stuff? You can write this easily in just PHP. Why don't you understand this?
    DOA:
    bstorer:
    Just because you can't figure out how to write a PHP page with proper separation of business logic from display logic doesn't mean that good developers can't. I'd take a moment to reassess my abilities if I were you.
    That's funny coming from someone who can't even tell the difference between a language and a template engine.
    I'm starting to get concerned that you don't understand the difference. I'll ask again: what do you expect to accomplish with Smarty that can't be done just as easily with PHP-sans-Smarty?
  • 07-15-2008 3:09 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:
    I don't understand why everyone's comparing PHP with Smarty. One's a programming language, the other a template engine.

    Holy fuck you're stupid.  PHP HAS TEMPLATING BUILT INTO THE LANGUAGE.  IT IS A CORE FEATURE.

     

    DOA:
    FACT: For anything above kindergarten level you can't get away with "<php code><my human readable text here><php code>". It. Just. Doesn't. Work. To find out why you need only try it out for yourself.

    I assure you I know a fuck of a lot more about PHP than you do.  All my logic is written in PHP and is composed of various business objects.  All of my templates are in their own files and essentially look like "<php code><html><php code>".  This is all you need.  The business logic handles construct all of the data and the PHP TEMPLATE FILES just echo variables, handle a light bit of conditional work (if($show_button), etc..) and  some light looping (like looping over an array of accounts, for example).  It's all very simple and looks dramatically different than my BUSINESS LOGIC WHICH IS WRITTEN IN PHP BUT IS NOT IN THE FUCKING TEMPLATE FILES.  Are you getting it yet?  Anyone with minor HTML and CSS experience can quickly learn how to edit the templates.  I HAVE NO NEED FOR SMARTY BECAUSE PHP ALREADY HAS TEMPLATING AS A CORE-FUCKING-FEATURE.

  • 07-15-2008 3:20 PM In reply to

    • stratos
    • Top 50 Contributor
    • Joined on 09-06-2006
    • Zeeland, Netherlands
    • Posts 536

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    morbiuswilters:


    some good stuff.



    BUT WAIT!, theres more. It's amazing. The guys from php even went as far as to create a variant syntax for php that's more easier understood. specifically for use in templates.

    So instead of having to write <? echo $title; ?>  you can now write <?=$title;?> isn't it amazing!

    But wait, it gets even better. As to not confuse your designers with those weird curly brackets, they added alternative variants, so now you can just

    <? IF ($first_post): ?>

    <? ENDIF; ?>
    My web-consulting company - My web development blog - "Show me a sane man and I will cure him for you." - C. G. Jung
  • 07-15-2008 3:21 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    stratos:
    BUT WAIT!, theres more. It's amazing. The guys from php even went as far as to create a variant syntax for php that's more easier understood. specifically for use in templates.

    So instead of having to write <? echo $title; ?>  you can now write <?=$title;?> isn't it amazing!

    But wait, it gets even better. As to not confuse your designers with those weird curly brackets, they added alternative variants, so now you can just

    <? IF ($first_post): ?>

    <? ENDIF; ?>
    Well, sure. But what about internationalization? Did you know that in some languages, "endif" isn't even a word?!
  • 07-15-2008 3:27 PM In reply to

    • stratos
    • Top 50 Contributor
    • Joined on 09-06-2006
    • Zeeland, Netherlands
    • Posts 536

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

     

    bstorer:
    stratos:
    BUT WAIT!, theres more. It's amazing. The guys from php even went as far as to create a variant syntax for php that's more easier understood. specifically for use in templates.

    So instead of having to write <? echo $title; ?>  you can now write <?=$title;?> isn't it amazing!

    But wait, it gets even better. As to not confuse your designers with those weird curly brackets, they added alternative variants, so now you can just

    <? IF ($first_post): ?>

    <? ENDIF; ?>
    Well, sure. But what about internationalization? Did you know that in some languages, "endif" isn't even a word?!

    If my biggest concern with designers would be that i would have to explain them what the funny words between the php tags are, then i would be a happy man.

    My web-consulting company - My web development blog - "Show me a sane man and I will cure him for you." - C. G. Jung
  • 07-15-2008 3:29 PM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    morbiuswilters:
    <rant>
    Ok, don't have an aneurism. I take it you've actually tried a template engine like Smarty and it turned out to be worse than your own stuff then? And of course you had to add other languages to your pages which <php code><html><php code> handled beautifully?

     

    stratos:
    <spouting script-kiddie-level nonsense>
    Yeah,good luck with that.

     

    bstorer:
    <funny, funny comment>
    Yup, nothing proves your point like aimless inanity.

     

  • 07-15-2008 3:31 PM In reply to

    • stratos
    • Top 50 Contributor
    • Joined on 09-06-2006
    • Zeeland, Netherlands
    • Posts 536

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:
    stratos:
    <spouting script-kiddie-level nonsense>
    Yeah,good luck with that.
     

    thanks.

    I wondered when you would come to your senses. Apparently you just needed a good example.

    My web-consulting company - My web development blog - "Show me a sane man and I will cure him for you." - C. G. Jung
  • 07-15-2008 3:39 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:
    I take it you've actually tried a template engine like Smarty and it turned out to be worse than your own stuff then?

    For the sake of fuck, I DON'T HAVE ANY OF MY OWN STUFF.  I use PHP which itself has templating built in.  I don't need to use Smarty.

     

    DOA:
    And of course you had to add other languages to your pages which <php code><html><php code> handled beautifully?

    It's handled as well as it is in Smarty, because Smarty is essentially just PHP templating written on top of PHP.  There is nothing Smarty does that PHP doesn't do.  Stop with this ridiculous bullshit.  You've already been sk00l3d by almost everyone here.

  • 07-15-2008 3:43 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    DOA:
     
    bstorer:
    <funny, funny comment>
    Yup, nothing proves your point like aimless inanity.
    It works better than your present strategy of continuous denial mixed with stupidity on a level that should preclude you from even using the internet to begin with.
  • 07-15-2008 3:59 PM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    morbiuswilters:
    DOA:
    I take it you've actually tried a template engine like Smarty and it turned out to be worse than your own stuff then?
    For the sake of fuck, I DON'T HAVE ANY OF MY OWN STUFF.  I use PHP which itself has templating built in.  I don't need to use Smarty.
    So that's a no. Never actually used a 3rd party template engine, but you know for a fact your code is better. Alrighty then.

    bstorer:
    DOA:
     
    bstorer:
    <funny, funny comment>
    Yup, nothing proves your point like aimless inanity.
    It works better than your present strategy of continuous denial mixed with stupidity on a level that should preclude you from even using the internet to begin with.
    Yup, nothing proves your point like insults. At least mobius has some sort of argument to make, crippled as it is.

  • 07-15-2008 4:14 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    DOA:
    PHP is a programming language. Smarty is a template engine. Please tell me that you understand the difference.
    PHP is a templating language. Over time, it has grown to become a Turing-complete, feature-rich programming language (templating languages tend to do so). Because of this, people put business logic into PHP pages, and often they mistake it for a general-purpose language rather than a domain-specific language. This confusion is what's causing the flame war here.

    (Full disclosure: I write my web pages in Perl, using TemplateToolkit for templating. TT is busy gaining features, and sooner or later, I expect to come across a website written entirely in TT.)
  • 07-15-2008 4:20 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    Carnildo:
    Because of this, people put business logic into PHP pages, and often they mistake it for a general-purpose language rather than a domain-specific language.

    I was with you until this part.  PHP is a general-purpose language and has been for awhile.  It is not domain-specific but it still retains the templating system as well.

     

    Carnildo:
    This confusion is what's causing the flame war here.

    Wrong.  The flamewar is because DOA seems to think he needs a templating language on top of PHP and everyone else realizes that PHP has templating built into it.  End of story.

  • 07-15-2008 4:38 PM In reply to

    • DOA
    • Top 25 Contributor
    • Joined on 06-26-2007
    • Posts 703

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    morbiuswilters:
    The flamewar is because DOA seems to think he needs a templating language on top of PHP and everyone else realizes that PHP has templating built into it.
    Amusingly enough I'm the only one in this little flamewar to have actually used a 3rd party template engine.

  • 07-15-2008 4:41 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    I realize that this is kind of an out-of-place comment but I just have to ask: what about caching?

    AFAIK, Smarty has a built-in cache mechanism that (supposedly) reduces load times by bypassing reevaluation of the template. While I'm with the "PHP is itself a template language" crowd on the main topic, I keep wondering how this caching can be (easily) achieved in pure PHP.

    Anything obvious that I'm missing?
  • 07-15-2008 4:44 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact

    DOA:
    Amusingly enough I'm the only one in this little flamewar stupid enough to have actually used a 3rd party template engine.
    FTFY

    SpectateSwamp exposing aliens. Obviously the World needs SSDS


    [10:07] <fatdog> so from now on.. be sure to wear nice clean underwear
    [10:07] <mps> fatdog: That is simply not going to happen
  • 07-15-2008 4:51 PM In reply to

    Re: That's what SMARTY were designed for...

    Locked Reply Contact
    DOA:

    morbiuswilters:
    The flamewar is because DOA seems to think he needs a templating language on top of PHP and everyone else realizes that PHP has templating built into it.
    Amusingly enough I'm the only one in this little flamewar to have actually used a 3rd party template engine.

    I was trying to convince some people last week that sugar works better in cars than gasoline. Amusingly enough, I was the only one in that little flamewar to put sugar in my gas tank.
Page 1 of 2 (83 items) 1 2 Next >
Powered by Community Server (Non-Commercial Edition), by Telligent Systems