PHP code example of mykehowells / powerhtml

1. Go to this page and download the library: Download mykehowells/powerhtml library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

mykehowells / powerhtml example snippets


$powerHtml = new \PowerHTML\PowerHTML;

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

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

$powerHtml->render();


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

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

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

$powerHtml = new \PowerHTML\PowerHTML( $options );
require __DIR__ . '/../vendor/autoload.php'