mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-13 13:54:23 +00:00
add eventDispatcher for new page
This commit is contained in:
parent
735425f2fd
commit
a9522d5b4b
@ -3,6 +3,8 @@
|
||||
namespace Chill\EventBundle\Controller;
|
||||
|
||||
use Chill\EventBundle\Entity\Participation;
|
||||
use Chill\PersonBundle\Privacy\PrivacyEvent;
|
||||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Chill\PersonBundle\Form\Type\PickPersonType;
|
||||
@ -20,6 +22,21 @@ use Symfony\Component\Form\Extension\Core\Type\HiddenType;
|
||||
*/
|
||||
class EventController extends Controller
|
||||
{
|
||||
/**
|
||||
* @var EventDispatcherInterface
|
||||
*/
|
||||
protected $eventDispatcher;
|
||||
|
||||
/**
|
||||
* EventController constructor.
|
||||
*
|
||||
* @param EventDispatcherInterface $eventDispatcher
|
||||
*/
|
||||
public function __construct(EventDispatcherInterface $eventDispatcher)
|
||||
{
|
||||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
|
||||
public function mostRecentIndexAction()
|
||||
{
|
||||
@ -247,6 +264,12 @@ class EventController extends Controller
|
||||
array('person' => $person)
|
||||
);
|
||||
|
||||
$privacyEvent = new PrivacyEvent($person, array(
|
||||
'element_class' => Participation::class,
|
||||
'action' => 'list'
|
||||
));
|
||||
$this->eventDispatcher->dispatch(PrivacyEvent::PERSON_PRIVACY_EVENT, $privacyEvent);
|
||||
|
||||
return $this->render('ChillEventBundle:Event:listByPerson.html.twig', array(
|
||||
'participations' => $participations,
|
||||
'person' => $person
|
||||
|
@ -32,6 +32,7 @@ class ChillEventExtension extends Extension implements PrependExtensionInterface
|
||||
$loader->load('forms.yml');
|
||||
$loader->load('fixtures.yml');
|
||||
$loader->load('menu.yml');
|
||||
$loader->load('controller.yml');
|
||||
}
|
||||
|
||||
/* (non-PHPdoc)
|
||||
|
5
Resources/config/services/controller.yml
Normal file
5
Resources/config/services/controller.yml
Normal file
@ -0,0 +1,5 @@
|
||||
services:
|
||||
Chill\EventBundle\Controller\EventController:
|
||||
arguments:
|
||||
$eventDispatcher: '@Symfony\Component\EventDispatcher\EventDispatcherInterface'
|
||||
tags: ['controller.service_arguments']
|
Loading…
x
Reference in New Issue
Block a user