PHP code example of marwanalsoltany / php-html

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

    

marwanalsoltany / php-html example snippets



// on the fly
echo MAKS\PhpHtml\HTML::div('This is a div!', ['class' => 'container']);

// the whole deal
echo (new \MAKS\PhpHtml\HTML())
    ->element('h1', 'HTML Forms', ['class' => 'title'])
    ->open('form', ['method' => 'POST'])
        ->comment('SIMPLE FORM')
        ->h2('Example', ['class' => 'subtitle'])
        ->p('This is an example form.')
        ->br()
        ->if(isset($variable))->div('$variable is set')
        ->open('fieldset')
            ->legend('Form 1', ['style' => 'color: #333;'])
            ->label('Message: ', ['class' => 'text'])
            ->input(['type' => 'text', '