1. Go to this page and download the library: Download jbsnewmedia/vis-bundle 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/ */
jbsnewmedia / vis-bundle example snippets
use JBSNewMedia\VisBundle\Model\Tool;
use JBSNewMedia\VisBundle\Service\Vis;
class YourController extends VisAbstractController
{
public function __construct(private Vis $vis)
{
$tool = new Tool('dashboard');
$tool->setTitle('Dashboard');
$tool->addRole('ROLE_ADMIN');
$this->vis->addTool($tool);
$this->vis->setTool('dashboard');
}
}
use JBSNewMedia\VisBundle\Model\Sidebar\SidebarItem;
use JBSNewMedia\VisBundle\Model\Sidebar\SidebarHeader;
// Add header section
$header = new SidebarHeader('dashboard', 'main_section', 'Main Navigation');
$this->vis->addSidebar($header);
// Add navigation item
$item = new SidebarItem('dashboard', 'users', 'Users', 'admin_users_list');
$item->setIcon('<i class="fa-solid fa-users"></i>');
$item->setOrder(10);
$item->addRole('ROLE_ADMIN');
$this->vis->addSidebar($item);
use JBSNewMedia\VisBundle\Plugin\AbstractPlugin;
#[AsTaggedItem('vis.plugin')]
class CustomPlugin extends AbstractPlugin
{
public function init(): void
{
// Plugin initialization logic
}
public function setNavigation(): void
{
$item = new SidebarItem('tools', 'custom_feature', 'Custom Feature');
$item->setRoute('custom_feature_index');
$this->vis->addSidebar($item);
}
public function setTopBar(): void
{
// Add custom topbar elements
}
}
bash
php bin/console vis:core:create
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.