2017 © Pedro Peláez
 

library php-page

Page system to use with RainTpl

image

lcloss/php-page

Page system to use with RainTpl

  • Saturday, February 17, 2018
  • by lcloss
  • Repository
  • 1 Watchers
  • 0 Stars
  • 9 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

php-page

A simple Class to work with RainTpl (Template System), (*1)

Getting Started

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)

Prerequisites

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)

Installing

Installation with Git:, (*4)

git clone https://github.com/lcloss/php-page.git

Instalação com o Composer:, (*5)

composer require lcloss/php-page

Running the tests

Initial setup

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',
]);

Creating a template

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!

Built With

  • RainTpl - The template system used

Contributing

Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us., (*13)

Versioning

We use GitHub for versioning. For the versions available, see the tags on this repository., (*14)

Authors

  • Luciano Closs - Initial work - LCloss

See also the list of contributors who participated in this project., (*15)

License

This project is licensed under the MIT License - see the LICENSE.md file for details, (*16)

Acknowledgments

The Versions

17/02 2018

dev-master

9999999-dev https://github.com/lcloss/php-page

Page system to use with RainTpl

  Sources   Download

MIT

The Requires

 

by Luciano Closs

template php templating template system