Skip to content

fouber/phiz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

47 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Pure PHP Template Engine

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages