Basic
Demo[area://sensei/docs/ui/pathbar/example-basic]
Code[area://sensei/docs/ui/pathbar/example-basic]
<?php
use Nether\Atlantis;
echo Atlantis\UI\Pathbar::FromSurfaceWithItems($Surface, [
Atlantis\Struct\Item::New(Icon: 'mdi-home', URL: '?section=home', Info: 'Home'),
Atlantis\Struct\Item::New(Title: 'One', URL: '?section=one'),
Atlantis\Struct\Item::New(Title: 'Two', URL: '?section=two'),
Atlantis\Struct\Item::New(Title: 'Three', URL: '?section=three')
]);
More Fancy
Demo[area://sensei/docs/ui/pathbar/example-more]
Code[area://sensei/docs/ui/pathbar/example-more]
<?php
use Nether\Atlantis;
use Nether\Common;
// pretending these came from a route or another template that wraps this
// element up to be clean for our uses.
$More = Common\Datastore::FromArray([
Atlantis\Struct\Item::New(Title: 'Final Thing')
]);
////////
$Items = Common\Datastore::FromArray([
Atlantis\Struct\Item::New(Title: 'Docs', URL: '/docs', Classes: [ 'tag' ]),
Atlantis\Struct\Item::New(Title: 'UI Elements', URL: '/docs/ui')
]);
if(isset($More) && is_iterable($More))
$Items->MergeRight($More);
////////
echo Atlantis\UI\Pathbar::FromSurfaceWith($Surface, [
'Separator' => 'mdi-slash-forward',
'Classes' => [ 'fs-smallerer' ],
'Items' => $Items
]);
Less Fancy
Demo[area://sensei/docs/ui/pathbar/example-less]
Code[area://sensei/docs/ui/pathbar/example-less]
<?php
use Nether\Atlantis;
use Nether\Common;
// pretending these came from a route or another template that wraps this
// element up to be clean for our uses.
$More = Common\Datastore::FromArray([
Atlantis\Struct\Item::New(Title: 'Final Thing')
]);
////////
$Items = Common\Datastore::FromArray([
Atlantis\Struct\Item::New(Title: 'Docs', URL: '/docs'),
Atlantis\Struct\Item::New(Title: 'UI Elements', URL: '/docs/ui')
]);
if(isset($More) && is_iterable($More))
$Items->MergeRight($More);
////////
echo Atlantis\UI\Pathbar::FromSurfaceWith($Surface, [
'Separator' => NULL,
'Items' => $Items
]);