PHP code example of aura / html

1. Go to this page and download the library: Download aura/html 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/ */

    

aura / html example snippets



$factory = new \Aura\Html\HelperLocatorFactory;
$helper = $factory->newInstance();


namespace Vendor\Package;

use Aura\Html\Helper\AbstractHelper;

class Obfuscate extends AbstractHelper
{
    public function __invoke($string)
    {
        return $this->escaper->html(str_rot13($input));
    }
}


$helper->set('obfuscate', function () {
    return new \Vendor\Package\Obfuscate;
});

<?= $helper->obfuscate('plain text') 
html+php
<head>

    <style>
        body {
            color: <?= $this->escape()->css($theme->color) 
html+php

// assign the escaper helper properties to callable variables
$h = $this->escape()->html;
$a = $this->escape()->attr;
$c = $this->escape()->css;
$j = $this->escape()->js;
html+php
 use Aura\Html\Escaper as e;