Guest User

Untitled

a guest
Aug 25th, 2016
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. <?php
  2.  
  3. namespace Acme\Bundle\ContractBundle\Controller;
  4. use Symfony\Bundle\FrameworkBundle\Controller\Controller;
  5.  
  6. class ContractController extends Controller
  7. {
  8. public function eventAction(Contract $contract)
  9. {
  10. $event = new ContractEvent($contract);
  11.  
  12. $dispatcher = $this->get('event_dispatcher');
  13. $dispatcher->dispatch(
  14. ContractEvents::CONTRACT_CREATED,
  15. $event
  16. );
  17.  
  18. return $this->render('AcmeContractBundle:Contract:index.html.twig', array(
  19. 'contract' => $contract
  20. ));
  21. }
  22. }
Add Comment
Please, Sign In to add comment