Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8338227
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:31:37+00:00 2026-06-09T04:31:37+00:00

IN the symfony2 Docs , they say to use this code $listener = new

  • 0

IN the symfony2 Docs , they say to use this code

$listener = new AcmeListener();
$dispatcher->addListener('foo.action', array($listener, 'onFooAction'));

I have two questions

  1. IN which file do i need to write that line
  2. what other events i can write in first arguments like foo.action. i mean is that event buitin or doctrine event or symfony event or custom defined
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:31:39+00:00Added an answer on June 9, 2026 at 4:31 am

    You have to write in your controller like this

    if ($form->isValid()) {
                $em = $this->getDoctrine()->getEntityManager();
                $em->persist($entity);
                $em->flush();
    
    
                $dispatcher = $this->container->get('event_dispatcher');
                $dispatcher->dispatch('your.event.name', new YourEvent($entity));
    
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Symfony docs they say to use this <div> {{ form_label(form.task) }} {{ form_errors(form.task)
My Symfony2 application replaces my PHPSESSID cookie when it logs me in. Is this
New to Symfony2. I followed several tutorials to install & configure Sonata with FOSUser
i am following part 5 of the symblog symfony2 tutorial: http://tutorial.symblog.co.uk/docs/customising-the-view-more-with-twig.html under heading: The
I'm new to Symfony2 (with knowledge in 1.2-1.4) and having little trouble trying to
I am new to symfony2 and and now i have installed Sonata Admin bundle.
How can I use the Symfony2 ClassLoader to autoload classes that dont follow PEAR
Following the docs in the bundle, I get this exception: InvalidConfigurationException: Unrecognized options fos_facebook
I've spent a while looking through the symfony2 docs trying to find a suitable
I'm using the symfony2 framework and I want to use the PHP's DateTime class

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.