SitePoint Sponsor

User Tag List

Page 2 of 3 FirstFirst 123 LastLast
Results 26 to 50 of 52
  1. #26
    Wanna-be Apple nut silver trophy M. Johansson's Avatar
    Join Date
    Sep 2000
    Location
    Halmstad, Sweden
    Posts
    7,400
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Originally posted by kunal
    hey.. i was write.. you have to manually recompile your templates for them to work

    Also, anyone know abt smarty's perfomance if caching is turned off? the true perfomance?
    I am playing around with Smarty right now, and I can testify that it does indeed automatically compile the templates.
    Mattias Johansson
    Short, Swedish, Web Developer

    Buttons and Dog Tags with your custom design:
    FatStatement.com

  2. #27
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    me was wrong @#$%ing docs
    i dunno...

  3. #28
    Almeaty Member
    Join Date
    Jul 2000
    Location
    Nowhere
    Posts
    278
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    phemplate

    http://pukomuko.esu.lt/phemplate/

    That's what I found thru HotScripts. A little confusing with all the sets and do's but seems ok

  4. #29
    SitePoint Member
    Join Date
    Feb 2002
    Posts
    4
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP Templating Systems

    My programmer at work and I use a stripped down version of FastTemplate http://www.thewebmasters.net/php/FastTemplate.phtml.

    He took everything out of it but the loadTemplate & parseTemplate functions. We may need to add teh caching back in for a couple of our sites shortly.

    A few months back, while learning/playing with classes, I tested Smarty, the class version of FastTemplate and a couple others. Our little two function one was faster (cause it wasn't doing everything). Granted it is missing a lot of the stuff we'd like to do that the others can ... but that's my two cents.
    ---------------------------------------------------
    "Philosophy will clip an angel's wings."
    By John Keats
    ---------------------------------------------------

  5. #30
    SitePoint Evangelist AlexC's Avatar
    Join Date
    Oct 2000
    Location
    Sheffield, UK
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    http://templatepower.codeocad.com (i think)

    and it is quite honestly the best template system i have used...imo

    Alex
    Nearly 7 years old!

  6. #31
    SitePoint Evangelist =X='s Avatar
    Join Date
    Jun 2001
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    PHP-Webservices - Profesional Hosting and Programming of sites.

  7. #32
    SitePoint Evangelist AlexC's Avatar
    Join Date
    Oct 2000
    Location
    Sheffield, UK
    Posts
    437
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thats the one :-)
    Nearly 7 years old!

  8. #33
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    looks very similar to phplib
    i dunno...

  9. #34
    SitePoint Evangelist =X='s Avatar
    Join Date
    Jun 2001
    Posts
    487
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    what about the system phpBB2 is using?
    also derived from phpLIB
    PHP-Webservices - Profesional Hosting and Programming of sites.

  10. #35
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    i havent seen it nor could i find it...
    i dunno...

  11. #36
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Just a though, if we use XML and XSL, then get PHP to parse it to XHTML on the server before displaying it, wouldn't that eliminate the need of templates?

    Plus XML/XSL is sort of the standard as well. Making a XSL style sheet is a bit harder than a normal XHTML template that's all.

  12. #37
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    not everyone has XML support compiled in php
    i dunno...

  13. #38
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Ask your host to add it?

    on a side note aletia.com supports XML and a bunch of other stuff.

  14. #39
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    lol.. i wish it were so easy to convince any host
    i dunno...

  15. #40
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I had a different experience with aletia.com, I dunno if it's a stroke of luck or not, but I asked them about mod_gzip for Apache, and next week, mod_gzip was a standard in all hosting packages. They also upgraded their servers to use PHP 4.1.x soon after some testing was complete.

    My site does have downtime, but I like the fact that they take the time to upgrade their softwares, which allows me to use new features, don't have to worry about backward compatibility since they have PHP 4.1, and use things like mod_rewrite and XML/XSL.

  16. #41
    SitePoint Addict kunal's Avatar
    Join Date
    Oct 2000
    Posts
    307
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    mod_gzip would help them reduce there costs they would definately add it :P
    i dunno...

  17. #42
    midnight coder
    Join Date
    Dec 2000
    Location
    The flat edge of the world
    Posts
    838
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Double edged sword. It also lowers my monthly traffic, so less chance of me exceeding the traffic limit and give them more money.

  18. #43
    mohrt2
    SitePoint Community Guest

    Smarty comments

    No you don't have to recompile manually. Smarty does this automatically when you change a template, and Smarty only recompiles templates that are changed. Also, the documentation for 2.0 (coming sometime this week) is completely restructured, much easier read. It also has a plugin architecuture and has performance tuneups up to 80% faster than Smarty 1.5.2. See the benchmark page.

    http://www.phpinsider.com/benchmarks/

  19. #44
    SitePoint Guru
    Join Date
    Feb 2002
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello!

    Im just looking into Smarty, and i got it to work proper.
    But i don't know, either im stupid or..i simply don't get it

    Would anybody care to tell me how i am supposed to do this with smarty?
    PHP Code:
    while ($row $rs->fetchArray())
    {
    $bg_color = ($x == 0) ? "index_color1" "index_color2";
    $bg_color2 = ($y == 0) ? "index_color3" "index_color4";
    echo (
    "<tr>\n");
    echo (
    "    <!-- Firmenname -->\n");
    echo (
    "    <td class=\"$bg_color\"><a href=\"index.php?fid=" $row['F_ID'] . "\">" $row['F_Name1'] . "</a></td>\n\n");

    // Wenn Firmentelefonnummer nicht leer ist dann anzeigen.
    echo ("    <!-- Firmentelefonnummer -->\n");
    if (
    $row['firma_tel'] !== '') echo ("    <td class=\"$bg_color\">" $row['firma_tel'] . "</td>\n\n");
    // ... etc.. 
    Ok, forget about the german commments...i think it is pretty clear where this is going...

    But i would like to know how am i supposed to COMPLETELY strip out the HTML of this?
    Im so confused

    Thanks!

  20. #45
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    Alkmaar, Netherlands
    Posts
    710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    check the sections part of the document from smarty.
    You can create array of arrays in your while statement and then send it to your smarty object.
    PHP Code:
    while (){
      
    $myarray[]= array( bgcolor=>'#whatever'fid=> $fid);
    }

    $smarty->assign( array( "smartysection"=> $myarray) ); 
    check out this link http://www.phpinsider.com/php/code/Smarty/QUICKSTART
    Last edited by sylow; May 21, 2002 at 08:22.

  21. #46
    SitePoint Guru
    Join Date
    Feb 2002
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello!

    This doesn't work, im getting the following parse error
    Parse error: parse error, unexpected T_DOUBLE_ARROW in e:\apache\web\intern\smarty\index.php on line 14

    I think i understand how to use smarty in general, but what i don't understand is how i can get it to loop things.

    A simple example
    PHP Code:
    // i have selected something from my database

    //Now i want to LOOP the following
    while ($row mysql_fetch_array($result)
    {
        <
    TD>$row['whatever']</TD>

    How can i do this with Smarty?
    Cause normally i would put the <td> and </td> tags in my template file...


    Now, normally if i was only going to need ONE row i could do as follows
    //in my template file
    <td>{$Row}</td>

    //in my php file
    $smarty->assign("Row","$row['whatever'");

    *superconfused* (please help)

  22. #47
    SitePoint Guru
    Join Date
    Jan 2001
    Location
    Alkmaar, Netherlands
    Posts
    710
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    index.tpl is below

    {section name=idx loop=$myarray}
    <td>{$myarray[idx]}</td>
    {/section}


    and php code is below
    PHP Code:
    require("Smarty.class.php");
    $smarty = new Smarty;
    while (
    $row mysql_fetch_array($result)
    {
        
    $myarray[] = $row['whatever'];
    }
    $smarty->assign("myarray"$myarray);
    $smarty->display("index.tpl"); 

  23. #48
    SitePoint Guru
    Join Date
    Feb 2002
    Posts
    625
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)


    Oh man, thanks a lot.
    Dank U vriendelijk. (ja ik kan ook Nederlands, ben in Belgie geboren :P)

    Again, thanks thanks thanks, you just made my day.

    I just couldn`t figure this out.

    *dances around computer showing tongue*

  24. #49
    Talk to the /dev/null Theiggsta's Avatar
    Join Date
    Mar 2001
    Location
    Tampa, FL
    Posts
    376
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Skunk:

    I actually use patTemplate... the good folks @ php-tools.de made a very cool and easy to use templating system thats rather fast. So far there is a tutorial on basic and advanced use of this system and so far its incredibly fast, with rendertimes clocking under 50ms.

    If anyone is going the XML route, I reccomend patXMLRenderer which utilizes the patTemplate system as well. Smarty is nice and quite fast, but i found patTemplate easiest to use and manage.
    Aaron "Theiggsta" Kalin
    Pixel Martini
    Ruby and Rails Developer

  25. #50
    Mlle. Ledoyen silver trophy seanf's Avatar
    Join Date
    Jan 2001
    Location
    UK
    Posts
    7,168
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for that Aaron. I have just been playing about with it and it seems to be very good

    Sean
    Harry Potter

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


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
  •