1. Go to this page and download the library: Download jnjxp/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/ */
jnjxp / html example snippets
use Jnjxp\Html\Factory as HtmlFactory;
$helper = (new HtmlFactory())->newInstance();
// example calling the icon helper
$helper->icon('foo');
$helper->icon->__invoke('foo');
$helper('icon','foo');
$helper->breadcrumb(['id' => 'test']); // (array) optional attributes
// add a single item to be escaped
$helper->breadcrumb()
->item('Home', '/', ['class' => 'foo']); // (title, uri, attributes)
// add several items to be escaped
$helper->breadcrumb()->items(
[ // key as uri value as title or array of attributes with title as first key
'/' => 'Home',
'/foo' => [ 'Foo', 'class' => 'foo']
'Bar' // numeric index, URI defaults to "#"
]
);
// add a single raw item not to be escaped
$helper->breadcrumb()->rawItem('<span>Home</span>', '/', ['class' => 'foo']);
// add several raw items not to be escaped
$helper->breadcrumb()->items(
[
'/' => '<span>Home</span>',
'/foo' => ['Foo', 'class' => 'foo']
'Bar'
]
);
// set path to public root
$helper->cacheBust->setPublic('/var/www');
// returns /build/assets/js/app-a9341845.js
$helper->cacheBust('assets/js/app.js', 'build/rev-manifest.json');
// can set a default manifest as well
$helper->cacheBust->setDefaultManifest('build/rev-manifest.json');
$helper->cacheBust('assets/js/app.js');