367 search results for EasyAdmin

EasyAdmin For an Awesomely Powerful Admin Area

So... your site needs an admin area. Do yourself a favor and skip all that custom code and jump straight into EasyAdmin bundle. Why #1? Because it'll take you a fraction of the time to build what you need. Why #2 ...

40 videos
|
4:19:16
Installing EasyAdmin

Well hey friends! We are in for a treat with this tutorial! It's EasyAdmin: my favorite admin generator for Symfony. It just... gives you so many features out of the box. And it looks great! This shouldn't really be a ...

3:29
Linking to EasyAdmin from Twig

... us directly to the edit action for this specific question. So... how do we generate URLs to EasyAdmin from Twig? Open the template for this page - templates/question/show.html.twig - and find the <h1>. Here it is. For ...

5:01
// ... lines 1 - 2
namespace AppBundle\Controller\EasyAdmin;
class GenusController extends AdminController
{
public function changePublishedStatusAction()
{
$id = $this->request->query->get('id');
$entity = $this->em->getRepository('AppBundle:Genus')->find($id);
$entity->setIsPublished(!$entity->getIsPublished());
$this->em->flush();
$this->addFlash('success', sprintf('Genus %spublished!', $entity->getIsPublished() ? '' : 'un'));
return $this->redirectToRoute('easyadmin', [
'action' => 'show',
'entity' => $this->request->query->get('entity'),
'id' => $id,
]);
}
}
See Code Block in Script
// ... lines 1 - 2
namespace AppBundle\Controller\EasyAdmin;
// ... lines 4 - 6
class UserController extends AdminController
{
// ... lines 9 - 15
}
See Code Block in Script
// ... lines 1 - 2
namespace AppBundle\Controller\EasyAdmin;
class GenusController extends AdminController
{
// ... lines 7 - 23
}
See Code Block in Script
// ... lines 1 - 2
namespace AppBundle\Controller\EasyAdmin;
use JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController as BaseAdminController;
class AdminController extends BaseAdminController
{
}
See Code Block in Script
// ... lines 1 - 2
namespace AppBundle\Controller\EasyAdmin;
use JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController as BaseAdminController;
class AdminController extends BaseAdminController
{
// ... lines 9 - 25
}
See Code Block in Script
// ... lines 1 - 2
namespace App\EasyAdmin;
// ... lines 4 - 5
use EasyCorp\Bundle\EasyAdminBundle\Contracts\Field\FieldConfiguratorInterface;
// ... lines 7 - 10
class TruncateLongTextConfigurator implements FieldConfiguratorInterface
{
// ... lines 13 - 21
}
See Code Block in Script
// ... lines 1 - 2
namespace AppBundle\Controller\EasyAdmin;
use AppBundle\Entity\User;
use JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController as BaseAdminController;
class UserController extends BaseAdminController
{
/**
* @param User $entity
*/
protected function preUpdateEntity($entity)
{
// ... line 15
}
}
See Code Block in Script
// ... lines 1 - 6
class AdminController extends BaseAdminController
{
public function changePublishedStatusAction()
{
$id = $this->request->query->get('id');
$entity = $this->em->getRepository('AppBundle:Genus')->find($id);
$entity->setIsPublished(!$entity->getIsPublished());
$this->em->flush();
$this->addFlash('success', sprintf('Genus %spublished!', $entity->getIsPublished() ? '' : 'un'));
return $this->redirectToRoute('easyadmin', [
'action' => 'show',
'entity' => $this->request->query->get('entity'),
'id' => $id,
]);
}
}
See Code Block in Script
// ... lines 1 - 4
use AppBundle\Entity\Genus;
// ... lines 6 - 8
class AdminController extends BaseAdminController
{
// ... lines 11 - 18
public function dashboardAction()
{
// ... line 21
$genusRepository = $em->getRepository(Genus::class);
// ... lines 23 - 28
}
}
See Code Block in Script
// ... lines 1 - 6
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class AdminController extends BaseAdminController
{
// ... lines 11 - 15
/**
* @Route("/dashboard", name="admin_dashboard")
*/
public function dashboardAction()
{
// ... lines 21 - 28
}
}
See Code Block in Script
// ... lines 1 - 8
class AdminController extends BaseAdminController
{
// ... lines 11 - 15
/**
* @Route("/dashboard", name="admin_dashboard")
*/
public function dashboardAction()
{
$em = $this->getDoctrine()->getManager();
$genusRepository = $em->getRepository(Genus::class);
return $this->render('easy_admin/dashboard.html.twig', [
'genusCount' => $genusRepository->getGenusCount(),
'publishedGenusCount' => $genusRepository->getPublishedGenusCount(),
'randomGenus' => $genusRepository->findRandomGenus()
]);
}
}
See Code Block in Script
// ... lines 1 - 6
class AdminController extends BaseAdminController
{
public function changePublishedStatusAction()
{
$id = $this->request->query->get('id');
$entity = $this->em->getRepository('AppBundle:Genus')->find($id);
// ... lines 13 - 24
}
}
See Code Block in Script
// ... lines 1 - 7
class UserController extends BaseAdminController
{
// ... lines 10 - 12
protected function preUpdateEntity($entity)
{
$entity->setUpdatedAt(new \DateTime());
}
}
See Code Block in Script
// ... lines 1 - 4
use AppBundle\Entity\User;
// ... lines 6 - 7
class UserController extends BaseAdminController
{
/**
* @param User $entity
*/
protected function preUpdateEntity($entity)
{
// ... line 15
}
}
See Code Block in Script
// ... lines 1 - 6
class AdminController extends BaseAdminController
{
public function changePublishedStatusAction()
{
$id = $this->request->query->get('id');
$entity = $this->em->getRepository('AppBundle:Genus')->find($id);
$entity->setIsPublished(!$entity->getIsPublished());
$this->em->flush();
$this->addFlash('success', sprintf('Genus %spublished!', $entity->getIsPublished() ? '' : 'un'));
// ... lines 19 - 24
}
}
See Code Block in Script
// ... lines 1 - 6
class AdminController extends BaseAdminController
{
public function changePublishedStatusAction()
{
$id = $this->request->query->get('id');
$entity = $this->em->getRepository('AppBundle:Genus')->find($id);
$entity->setIsPublished(!$entity->getIsPublished());
$this->em->flush();
// ... lines 17 - 24
}
}
See Code Block in Script
// ... lines 1 - 6
class AdminController extends BaseAdminController
{
public function changePublishedStatusAction()
{
$id = $this->request->query->get('id');
$entity = $this->em->getRepository('AppBundle:Genus')->find($id);
// ... lines 13 - 24
}
}
See Code Block in Script