1. Go to this page and download the library: Download jdz/htmlrenderer 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/ */
use JDZ\Renderer\Button;
use JDZ\Renderer\ElementsTrait;
// In your toolbar/container class:
class Toolbar {
use ElementsTrait;
}
$toolbar = new Toolbar();
$toolbar->addElement(new Button('save')); // position 1
$toolbar->addElement(new Button('cancel')); // position 2
$toolbar->addElement(new Button('delete')); // position 3
// Reposition elements
$toolbar->setElementPosition('delete', 'first');
$toolbar->setElementPositionAfter('cancel', 'delete');
$toolbar->setElementPositionBefore('save', 'cancel');