PHP code example of sebastopolys / ginsenghtml

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

    

sebastopolys / ginsenghtml example snippets



namespace MyNamespace;

use GinsengHtml\ginsenghtml;

class myclass
{
    public function __construct(){
        new ginsenghtml();
    }
}


namespace MyNamespace;
use GinsengHtml\ginsenghtml;
use function GinsengHtml\{h2,div};

class MyTemplateFileClass
{
    public function print_some_html(){

        return div(['id'=>'head_div','style'=>'background-color:yellow;','content'=>
            h2('CONTENT HERE!')]);
    }
}

$array = [
        'id'=>'12',
        'class'=>'theclass class1'
        ];
                            
print_r( span( $array ) );

div( FALSE );

div( TRUE );

array(3,5,7,10);