SitePoint Sponsor

User Tag List

Results 1 to 11 of 11
  1. #1
    eigo hanasemasu ka? Yes. =) ZuulJin's Avatar
    Join Date
    Dec 2001
    Location
    Japan
    Posts
    655
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Anyone ever use patTemplates?

    I'm used to using fastTemplates primarily. I've been reading into patTemplates, and it looks real nice. I was wondering if anyone has used patTemplates before, and can someone give their opinions on it? Is it fast? It definitely looks flexible. It's probably not as robust as Smarty though. I don't really want a comparison, just opinions. The only real comparison I'd like would be speed (I'm sure everyone will say Smarty is the fastest).

    I've already read the article on DevShed about it. =) I think I'm going to 'write' my own version of it, mostly for learning purposes. I like 'rewriting' good pieces of code for learning... it definitely helps a lot.

    [Z]
    U.S. DoD Member in Japan?
    Choose your base. Buy|Sell. Easy
    @ APO Ads.



  2. #2
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Very good template class, but full of errors if you turn error reporting up

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  3. #3
    SitePoint Addict been's Avatar
    Join Date
    May 2002
    Location
    Gent, Belgium
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    If you're looking for the fastest template engine of them all, there can be only one, and that's... PHP!
    Per
    Everything
    works on a PowerPoint slide

  4. #4
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Been reading Vincent's posts?

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  5. #5
    SitePoint Addict been's Avatar
    Join Date
    May 2002
    Location
    Gent, Belgium
    Posts
    284
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Pssst, a lot, but don't tell him, he might feel stalked
    Per
    Everything
    works on a PowerPoint slide

  6. #6
    SitePoint Wizard silver trophy someonewhois's Avatar
    Join Date
    Jan 2002
    Location
    Canada
    Posts
    6,364
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't want to get into these rants..

    .. But:
    Allthough PHP is very fast, and useable, it still makes it hard to change a link or something, since you have to change it in every file

    If you have templates, you can just change the layout file, and it'll change it for your entire site

    I made my own template system, for my site, which uses MySQL, and has no fancy things.

    On my 19" monitor, at 1152x864, it fits on the page easily

    It's really short, and just uses str_replace, not like fastTemplate I used before which used ereg for some reason


    My template cut down on over a full second in load time from fastTemplate

  7. #7
    SitePoint Evangelist
    Join Date
    Oct 2001
    Posts
    592
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Not wanting to continue on these rants either, but...

    Those rants (of mine) never say that templates are nonsense. They only say that using third party template engines in PHP is a bit silly, because PHP already is a template engine. The fact that you (someonewhois) can write and use templates by a piece of PHP code that spans just one page simply proves that point.

    Vincent (who carefully looks over his shoulder as he presses 'submit'...)

  8. #8
    eigo hanasemasu ka? Yes. =) ZuulJin's Avatar
    Join Date
    Dec 2001
    Location
    Japan
    Posts
    655
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I'll clarify a little more... I've rebuilt fastTemplate to be PHP 4.2 compliant, replaced that ereg nonsense with str_replace, streamlined the code, and replaced " with ' where I could. It's faster now (actually benchmarked it, a single page loads .06 seconds faster, small page. )

    I started this thread because I read the article on devShed about patTemplate, then I went to the authors site. It's nice, and he has created many nice tools. I just want some opinions on patTemplate. Maybe a little bit of a comparison to fastTemplate. It looks like patTemplate is more flexible than fastTemplate is. patTemplate supports multiple templates within a single file, conditionals within a template, etc... It looks like it's well done.

    Appreciate the comments so far, keep them coming.

    [Z]
    U.S. DoD Member in Japan?
    Choose your base. Buy|Sell. Easy
    @ APO Ads.



  9. #9
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I decided not to use PT because it was just too much for what I need. I use a tiny class that opens files and replaces placeholders with values you pass to it

    Sean
    Harry Potter

    -- You lived inside my world so softly
    -- Protected only by the kindness of your nature

  10. #10
    Node mutilating coot timnz's Avatar
    Join Date
    Feb 2001
    Location
    New Zealand
    Posts
    516
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by someonewhois
    I don't want to get into these rants..

    .. But:
    Allthough PHP is very fast, and useable, it still makes it hard to change a link or something, since you have to change it in every file

    If you have templates, you can just change the layout file, and it'll change it for your entire site

    I made my own template system, for my site, which uses MySQL, and has no fancy things.
    You kinda missed the idea a bit. Yes you can use PHP that way in what would turn out to be a page with business type logic embedded in the markup of the resulting page, but you can also craft it so that PHP is still doing the "templating" natively, but that portion of it, does not deal with anything but presenting some data that it gets given.

    Sorry ZuulJin, I can't comment on patTemplate, as I haven't used it.
    Oh no! the coots are eating my nodes!

  11. #11
    eigo hanasemasu ka? Yes. =) ZuulJin's Avatar
    Join Date
    Dec 2001
    Location
    Japan
    Posts
    655
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I've given up on template engines all together. I now use PHP, but I've written a little class that ALMOST looks like a template class. It's not, it just makes my code smaller. For more about that, see this thread

    [Z]
    U.S. DoD Member in Japan?
    Choose your base. Buy|Sell. Easy
    @ APO Ads.




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
  •