Home

Awesome

Pure PHP Template Engine

Demo

Quick Start

index.php

<?php
require_once 'phiz/View.class.php';
$dir = dirname(__FILE__);
PhizView::setTemplateDir($dir . '/template');
PhizView::setMapDir($dir . '/map');
//init page and display
PhizView::page('foo-bar:page/Index.class.php')->display();

PhizView

a widget or block

source code (php style):

<?php

    //access permission
    $this->scope('private');

    //static resources
    $this->import('lib/jquery/jquery.js');
    $this->import('lib/bootstrap/bootstrap.css');
    
    //inputs
    $content = $this->input('content', 'hello world');

?>
<!-- html of view -->
<div><?php echo $content; ?></div>

source code (php class style)

<?php

class Foo_Widget_Bar extends PhizView
{

    protected function init()
    {
        //access permission
        $this->scope('private');
        
        //static resources
        $this->import('lib/jquery/jquery.js');
        $this->import('lib/bootstrap/bootstrap.css');
    }
    
    protected function loadTemplate()
    {
        //inputs
        $content = $this->input('content', 'hello world');
        $html  = '<!-- html of view -->';
        $html .= "<div>{$content}</div>";
        return $html;
    }
}

API Documentation

PhizView

PhizPage extend PhizView

Learn More