PHP code example of 8fold / php-markup

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

    

8fold / php-markup example snippets


$element = Element::fold("hello");

print $lement->unfold();

// output: <hello></hello>

$element = Element::fold("hello");

print $element;

// output: <hello></hello>

$element = Element::fold("hello")->attr("id my-element");

print $element;

// output: <hello id="my-element"></hello>

$html = Html::p();

print $html->unfold();

print $html;

$html = Html::ul(
  Html::li("Hello, "),
  Html::li("World!")
);

print $html;

// output:
// <ul><li>Hello, </li><li>World!</li></ul>

$uikit = UIKit::listWith(
  "Hello, ",
  "World!"
);

print($uikit);

// output: same as above

composer