PHP code example of marko / admin
1. Go to this page and download the library: Download marko/admin 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/ */
marko / admin example snippets
use Marko\Admin\Attributes\AdminSection;
use Marko\Admin\Contracts\AdminSectionInterface;
use Marko\Admin\MenuItem;
#[AdminSection(id: 'catalog', label: 'Catalog', icon: 'box', sortOrder: 20)]
class CatalogSection implements AdminSectionInterface
{
public function getId(): string { return 'catalog'; }
public function getLabel(): string { return 'Catalog'; }
public function getIcon(): string { return 'box'; }
public function getSortOrder(): int { return 20; }
public function getMenuItems(): array
{
return [
new MenuItem(id: 'products', label: 'Products', url: '/admin/catalog/products'),
];
}
}