2017 © Pedro Peláez
 

library powerhtml

HTML templating and parsing engine

image

mykehowells/powerhtml

HTML templating and parsing engine

  • Friday, January 13, 2017
  • by mykemeynell
  • Repository
  • 1 Watchers
  • 0 Stars
  • 24 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 0 % Grown

The README.md

PowerHTML/PowerHTML

Stable version Unstable version, (*1)

Create HTML template with .pwr.html extension and make use in emails or whatever else!, (*2)

Installation

composer require mykehowells/powerhtml, (*3)

Usage

Include the composer autoloader, (*4)

require __DIR__ . '/../vendor/autoload.php', (*5)

Getting started with a basic PowerHTML setup. The below code would output the processed PowerHTML template to the browser., (*6)

$powerHtml = new \PowerHTML\PowerHTML;

$template = ( $_SERVER[ 'REQUEST_URI'] == '/' ) ? null : ltrim( $_SERVER[ 'REQUEST_URI'], '/' );

$powerHtml->with( 'hello', 'hello world' )
    ->parse( $template );

$powerHtml->render();

If you're looking to store the parsed html into a variable, use store() rather than render()., (*7)

Options

Change Template Directory

Default: /resources/templates, (*8)

$options = [
    'template_dir' => __DIR__ . '/public/templates'
];

$powerHtml = new \PowerHTML\PowerHTML( $options );

Stop PHP Evaluation

Stopping PHP evaluation will stop the curly braces from being parsed in your templates. For example: {{$my_var}} would be output as {{$my_var}}., (*9)

$options = [
    'allow_php_eval' => false
];

$powerHtml = new \PowerHTML\PowerHTML( $options );

The Versions

13/01 2017

dev-master

9999999-dev https://github.com/mykehowells/powerparser

HTML templating and parsing engine

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

parser template php html power rich powerhtml powerparser

13/01 2017

0.0.7

0.0.7.0 https://github.com/mykehowells/powerparser

HTML templating and parsing engine

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

parser template php html power rich powerhtml powerparser

13/01 2017

0.0.6

0.0.6.0 https://github.com/mykehowells/powerparser

HTML templating and parsing engine

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

parser template php html power rich powerhtml powerparser

31/03 2016

0.0.5

0.0.5.0 https://github.com/mykehowells/powerparser

HTML templating and parsing engine

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

parser template php html power rich powerhtml powerparser

31/03 2016

0.0.4

0.0.4.0 https://github.com/mykehowells/powerparser

HTML templating and parsing engine

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

parser template php html power rich powerhtml powerparser

31/03 2016

0.0.3

0.0.3.0 https://github.com/mykehowells/powerparser

HTML templating and parsing engine

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

parser template php html power rich powerhtml powerparser

31/03 2016

0.0.2

0.0.2.0 https://github.com/mykehowells/powerparser

HTML templating and parsing engine

  Sources   Download

GPL

The Requires

  • php >=5.4.0

 

parser template php html power rich powerhtml powerparser