dev-master
9999999-dev https://github.com/lcloss/php-pagePage system to use with RainTpl
MIT
The Requires
- rain/raintpl ^3.1
- php >=7.0
by Luciano Closs
template php templating template system
Page system to use with RainTpl
A simple Class to work with RainTpl (Template System), (*1)
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system., (*2)
You will need a web server and PHP configured. This project is intended to be incorporated into another project, so the minimum prerequisite is the web server and PHP., (*3)
Installation with Git:, (*4)
git clone https://github.com/lcloss/php-page.git
Instalação com o Composer:, (*5)
composer require lcloss/php-page
The default folder for the templates is ../app/views/front. If you want to change the default folder, change the $ tpl_dir variable in the Page.php file., (*6)
In the view folder of your system, create the header.html and footer.html file. For this example, also create the home.html file., (*7)
At the end you will have a structure like:, (*8)
app/views/front/src/footer.html app/views/front/src/header.html app/views/front/src/home.html
In your application, use:, (*9)
use \LCloss\Page\Page; $page = new Page(); $page->setTpl('home', [ 'title' => 'Title of your Project', 'company' => 'Your company', ]);
Create a template called hello.html in your views folder. Type the following code:, (*10)
<p>Hello {$username}!</p>
Use as follow:, (*11)
use \LCloss\Page\Page; $page = new Page(); $page->setTpl('hello', [ 'username' => 'Frederico Ferdinando', ]);
You will see like this:, (*12)
Hello Frederico Ferdinando!
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us., (*13)
We use GitHub for versioning. For the versions available, see the tags on this repository., (*14)
See also the list of contributors who participated in this project., (*15)
This project is licensed under the MIT License - see the LICENSE.md file for details, (*16)
Page system to use with RainTpl
MIT
template php templating template system