Download the PHP package phower/view without Composer
On this page you can find all versions of the php package phower/view. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Package view
Short Description Standalone templating system for PHP scripts.
License MIT
Informations about the package view
Phower View
Standalone templating system for PHP scripts.
Requirements
Phower View requires:
Instalation
Add Phower View to any PHP project using Composer:
Usage
This package provides the essential tools for an application to output any kind of output response supported by an optional list of variables which are rendered inside templates.
Templates are plain PHP scripts which are rendered on a protected environment with all variables already available:
Assuming the template above is a file called my_template.php
then we can use it to
output a new set of variables:
Templates inside templates
Many times we find useful to implement more than one layer of templating with high level ones outputing other templates.
This can be achived by capturing the child template into a variable of the parent template:
JSON views
Other times we may wish to output a set of variables not using a template but just as a JSON plain representation:
Note that
JsonTemplate
is fully compatible with PHPjson_encode
so that we can also setoptions
anddepth
and use all the accepted values there on each instance ofJsonTemplate
.
Running Tests
Tests are available in a separated namespace and can run with PHPUnit in the command line:
Coding Standards
Phower code is written under PSR-2 coding style standard. To enforce that CodeSniffer tools are also provided and can run as:
Reporting Issues
In case you find issues with this code please open a ticket in Github Issues at https://github.com/phower/view/issues.
Contributors
Open Source is made of contribuition. If you want to contribute to Phower please follow these steps:
- Fork latest version into your own repository.
- Write your changes or additions and commit them.
- Follow PSR-2 coding style standard.
- Make sure you have unit tests with full coverage to your changes.
- Go to Github Pull Requests at https://github.com/phower/view/pulls and create a new request.
Thank you!
Changes and Versioning
All relevant changes on this code are logged in a separated log file.
Version numbers follow recommendations from Semantic Versioning.
License
Phower code is maintained under The MIT License.