Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/fouber/phiz
Pure PHP Template Engine
https://github.com/fouber/phiz
Last synced: 5 days ago
JSON representation
Pure PHP Template Engine
- Host: GitHub
- URL: https://github.com/fouber/phiz
- Owner: fouber
- Created: 2013-10-17T18:28:19.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2013-10-30T05:06:46.000Z (about 11 years ago)
- Last Synced: 2024-10-11T20:36:58.850Z (about 1 month ago)
- Language: PHP
- Size: 187 KB
- Stars: 20
- Watchers: 5
- Forks: 8
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
Pure PHP Template Engine
=======## Demo
* [phiz-demo](https://github.com/fouber/phiz-demo)
## Quick Start
index.php
```php
display();
```## PhizView
> a widget or block
source code (php style):
```php
scope('private');//static resources
$this->import('lib/jquery/jquery.js');
$this->import('lib/bootstrap/bootstrap.css');
//inputs
$content = $this->input('content', 'hello world');?>
```source code (php class style)
```php
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 .= "{$content}";
return $html;
}
}
```## API Documentation
### PhizView
* [input($key, $default = null)](https://github.com/fouber/phiz-demo/blob/master/common/layout/skeleton/skeleton.php#L12-L15): get inputs
* [import($id)](https://github.com/fouber/phiz-demo/blob/master/common/layout/skeleton/skeleton.php#L3-L6): require static resources.
* [load($id)](https://github.com/fouber/phiz-demo/blob/master/common/layout/skeleton/skeleton.php#L21): load other view.
* [scope($type)](https://github.com/fouber/phiz-demo/blob/master/foo/widget/table/table.php#L3): define access permission.
* [css()](https://github.com/fouber/phiz-demo/blob/master/common/layout/skeleton/skeleton.php#L24): display required css resources.
* [js()](https://github.com/fouber/phiz-demo/blob/master/common/layout/skeleton/skeleton.php#L29): display required js resources.
* [startScript()](https://github.com/fouber/phiz-demo/blob/master/foo-bar/widget/left/left.php#L12): ob_start to collect script code.
* [endScript()](https://github.com/fouber/phiz-demo/blob/master/foo-bar/widget/left/left.php#L12): ob_get_clean to stop collecting script code.
* [script()](https://github.com/fouber/phiz-demo/blob/master/common/layout/skeleton/skeleton.php#L30): display collected script code.
* [display()](https://github.com/fouber/phiz-demo/blob/master/foo-bar/index.php#L11): echo rendered html
* [fetch()](https://github.com/fouber/phiz-demo/blob/master/foo-bar/page/Index.class.php#L21): return rendered html
* [getPageData($key, $default)](https://github.com/fouber/phiz-demo/blob/master/common/layout/skeleton/skeleton.php#L12): get data from the unique PhizPage instance.### PhizPage extend PhizView
* [buildPage()](https://github.com/fouber/phiz-demo/blob/master/foo-bar/page/Index.class.php#L7-L22): abstract, return page rendered html.
## Learn More
* [sdk](https://github.com/fouber/phiz-tool)
* [demo](https://github.com/fouber/phiz-demo)