PHP code example of flextype-components / html

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

    

flextype-components / html example snippets


use Flextype\Component\Html\Html;

// Registering a Html macro
Html::macro('my_element', function() {
    return '<element id="flextype">';
});

// Calling a custom Html macro
echo Html::my_element();

// Registering a Html macro with parameters
Html::macro('my_element', function($id = '') {
    return '<element id="'.$id.'">';
});

// Calling a custom Html macro with parameters
echo Html::my_element('flextype');

echo Html::toText('test');

echo '<div'.Html::attributes($attrs).'>'.$content.'</div>';

echo Html::br(2);

echo Html::nbsp(2);

echo Html::arrow('right');

echo Html::anchor('About', 'http://sitename.com/about');

echo Html::heading('Title', 1);

echo Html::doctype('html5');

echo Html::image('data/files/pic1.jpg');

echo Html::email('[email protected]');

echo Html::obfuscate('[email protected]');