#24818 [NEW]: This is best php template

Ask a Question related to PHP Development, Design and Development.

  1. #1

    Default #24818 [NEW]: This is best php template

    From: springchun at 21cn dot com
    Operating system: linux
    PHP version: 4.3.1
    PHP Bug Type: Unknown/Other Function
    Bug description: This is best php template

    Description:
    ------------
    This is best php template than Smarty,FastTemplate and PHPLIB Template;
    Is it add this function into php5.0.dll?
    please seen 'http://www.cqlc.net/document.txt';
    function cqlctpl($file)
    {
    $fp=fopen($file,"r");

    $msg="echo\"".str_replace("\"","\\\"",fread($fp,fi lesize($file)))."\";";
    fclose($fp);
    $oldstr=array(0=>"/\{loop:([^\}]+)\}(.+)\{\/loop\}/si",
    1=>"/\{logi:([^\}]+)\}(.+)\{\/logi\}/si",
    2=>"/\{exec:([^\}]+)\}/si",
    3=>"/(\{\*[^\*]+\*\})/si"
    );
    $newstr=array(0=>"\";\\1{echo\"\\2\";}echo\"",
    1=>"\";\\1{echo\"\\2\";}echo\"",
    2=>"\";\\1;echo\"",
    3=>""
    );
    return preg_replace($oldstr,$newstr,$msg);
    }


    Reproduce code:
    ---------------
    <?
    function cqlctpl($file)
    {
    $fp=fopen($file,"r");

    $msg="echo\"".str_replace("\"","\\\"",fread($fp,fi lesize($file)))."\";";
    fclose($fp);
    $oldstr=array(0=>"/\{loop:([^\}]+)\}(.+)\{\/loop\}/si",
    1=>"/\{logi:([^\}]+)\}(.+)\{\/logi\}/si",
    2=>"/\{exec:([^\}]+)\}/si",
    3=>"/(\{\*[^\*]+\*\})/si"
    );
    $newstr=array(0=>"\";\\1{echo\"\\2\";}echo\"",
    1=>"\";\\1{echo\"\\2\";}echo\"",
    2=>"\";\\1;echo\"",
    3=>""
    );
    return preg_replace($oldstr,$newstr,$msg);
    }

    function test(){echo"<p>this is 2.tml ,welcome you";}

    $title="this is a tml";

    $body="this out ";

    for($i=0;$i<10;$i++)$array[$i]="hello world $i";

    eval(cqlctpl("1.txt"));



    Expected result:
    ----------------
    this is a tml (1.tml)
    this out is hello world 0

    this out is hello world 1

    this out is hello world 2

    this out is hello world 3

    this out is hello world 4

    this out is hello world 5

    this out is hello world 6

    6 is biger than 5

    this out is hello world 7

    7 is biger than 5

    this out is hello world 8

    8 is biger than 5

    this out is hello world 9

    9 is biger than 5

    time is 1059193623

    this is other tml(2.tml)
    this is 2.tml ,welcome you


    Actual result:
    --------------
    this is a tml (1.tml)
    this out is hello world 0

    this out is hello world 1

    this out is hello world 2

    this out is hello world 3

    this out is hello world 4

    this out is hello world 5

    this out is hello world 6

    6 is biger than 5

    this out is hello world 7

    7 is biger than 5

    this out is hello world 8

    8 is biger than 5

    this out is hello world 9

    9 is biger than 5

    time is 1059193623

    this is other tml(2.tml)
    this is 2.tml ,welcome you


    --
    Edit bug report at [url]http://bugs.php.net/?id=24818&edit=1[/url]
    --
    Try a CVS snapshot (php4): [url]http://bugs.php.net/fix.php?id=24818&r=trysnapshot4[/url]
    Try a CVS snapshot (php5): [url]http://bugs.php.net/fix.php?id=24818&r=trysnapshot5[/url]
    Fixed in CVS: [url]http://bugs.php.net/fix.php?id=24818&r=fixedcvs[/url]
    Fixed in release: [url]http://bugs.php.net/fix.php?id=24818&r=alreadyfixed[/url]
    Need backtrace: [url]http://bugs.php.net/fix.php?id=24818&r=needtrace[/url]
    Try newer version: [url]http://bugs.php.net/fix.php?id=24818&r=oldversion[/url]
    Not developer issue: [url]http://bugs.php.net/fix.php?id=24818&r=support[/url]
    Expected behavior: [url]http://bugs.php.net/fix.php?id=24818&r=notwrong[/url]
    Not enough info: [url]http://bugs.php.net/fix.php?id=24818&r=notenoughinfo[/url]
    Submitted twice: [url]http://bugs.php.net/fix.php?id=24818&r=submittedtwice[/url]
    register_globals: [url]http://bugs.php.net/fix.php?id=24818&r=globals[/url]
    PHP 3 support discontinued: [url]http://bugs.php.net/fix.php?id=24818&r=php3[/url]
    Daylight Savings: [url]http://bugs.php.net/fix.php?id=24818&r=dst[/url]
    IIS Stability: [url]http://bugs.php.net/fix.php?id=24818&r=isapi[/url]
    Install GNU Sed: [url]http://bugs.php.net/fix.php?id=24818&r=gnused[/url]

    springchun at 21cn dot com Guest

  2. Similar Questions and Discussions

    1. template help
      how can i create a background for my template? thanks! take a look, www.cassisdesign.com/nexsyis it will be on the software page that i am...
    2. template inside another template
      Hi All! I have a problem with templates! As far as I know there is a nested template in dw. A nested template means that a template can be...
    3. CFM in a PHP template?
      is there a way to execute CFM code in an existing PHP template? i was toying with a pre-made freeware template that, unfortunately, is all in...
    4. Using a Template as the base for another Template
      Hi, - Dreamweaver MX - Created a HTML-Template with some menu-items (normal hyperlinks) - I need to create on that menu-items some submenu-items...
    5. #24818 [Opn->Bgs]: This is best php template
      ID: 24818 Updated by: iliaa@php.net Reported By: springchun at 21cn dot com -Status: Open +Status: ...
  3. #2

    Default Re: #24818 [NEW]: This is best php template

    Template engine is in a sense a component that allows separation of php and HTML codes. When template engine is used in the application, HTML code is placed into separate files, templates. In addition to the HTML code, these files contain processing instructions that template engines execute, assembling the final HTML page which is downloaded and converted by browsers into what
    we see as Web pages. Typically, template engines execute a number of processing instructions, including, but certainly not limited to inserting a value of a certain variable, looping through a set of listings, displaying their titles, and including other template(s).
    Some free PHP template engine listed on the page: http://www.phpkode.com/projects/category/php-template-engine/
    Thousands of free PHP Scripts listed on PHPKode.com
    bizboy12 is offline Junior Member
    Join Date
    May 2011
    Posts
    1

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139