TCodes - the flexible, fast, and simple template engine for PHP!

Discussion in 'PHP' started by Awilum, May 1, 2011.

  1. #1
    I wrote this simple template engine for PHP!

    Simple php application

    <?php
        // Include TCodes
        include 'tcodes/TCodes.php';
    
        // Add new tcode
        addTCode('message','Hello world!');
    
        // Adding Dynamic Data
        $vars['admin'] = true;
        $vars['username'] = 'Username';	
    
        // Loading a Template
        template('templates/page.php',$vars);
    ?>
    Code (markup):
    Simple template

    <html>
    <head>
        <title>Simple template</title>
    </head>
    <body>
        {if:$admin}	
            {echo:$username}
        {end}
        <p>{message}</p>
    </body>
    </html>
    Code (markup):
    Site: http://tcodes.template-cms.org/
     
    Awilum, May 1, 2011 IP