setup admin interface
This commit is contained in:
parent
dfff8adb8f
commit
af10620337
8 changed files with 561 additions and 57 deletions
34
src/Controller/Admin/DashboardController.php
Normal file
34
src/Controller/Admin/DashboardController.php
Normal file
|
@ -0,0 +1,34 @@
|
|||
<?php
|
||||
|
||||
namespace App\Controller\Admin;
|
||||
|
||||
use App\Entity\User;
|
||||
use EasyCorp\Bundle\EasyAdminBundle\Config\Dashboard;
|
||||
use EasyCorp\Bundle\EasyAdminBundle\Config\MenuItem;
|
||||
use EasyCorp\Bundle\EasyAdminBundle\Controller\AbstractDashboardController;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
|
||||
class DashboardController extends AbstractDashboardController
|
||||
{
|
||||
/**
|
||||
* @Route("/admin", name="admin")
|
||||
*/
|
||||
public function index(): Response
|
||||
{
|
||||
return parent::index();
|
||||
}
|
||||
|
||||
public function configureDashboard(): Dashboard
|
||||
{
|
||||
return Dashboard::new()
|
||||
->setTitle('Plant Exchange');
|
||||
}
|
||||
|
||||
public function configureMenuItems(): iterable
|
||||
{
|
||||
yield MenuItem::linktoRoute('Back to the website', 'fas fa-arrow-left', 'homepage');
|
||||
yield MenuItem::linktoDashboard('Dashboard', 'fa fa-home');
|
||||
yield MenuItem::linkToCrud('User', 'fas fa-user', User::class);
|
||||
}
|
||||
}
|
Reference in a new issue