Find out what Controller is triggering an event in symfony2 - events

I need to trigger an event ONCE in my symfony2 project for each web
i have created an event that is dispatched whenever kernel.controller occurs, the problem is that this makes the event run six or seven times and I only want it to run once.
any ideas or suggestions?
if so,I wouldn't mind being able to know what controller triggered the event so I can put the code I want to put there!!

Related

Google Analytics: Event does not appear are being set up

Bear with me, because I'm relatively new to using GA and the people who set it up have either left or don't know how to use it. So there could be a deeper problem...
I'm trying to add an event via GTM, but it doesn't appear in my event list on GA. Everything, so far as I can tell, is set up correctly.
Do events not appear until they've been triggered? The product gets deployed to customers on a set-basis so there'll be a delay before the trigger is in the product
I chose the trigger as Click Classes and just added a class to the button. Is this enough to trigger the event?
Generally, you set up event tags in GTM that fires after a condition (like your Click Class) is triggered. Only after then, the event will get sent to Google Analytics and appear in your Events and Realtime reports.

Initialize and InitializeAsync fires once vs OnNavigatingTo that fired when navigating back too Prism 7.2

I have moved my project to prism 7.2
I have quite a few "OnNavigatingTo" and replaced accordingly with InitializeAsync or Initialize
If I remember correctly "OnNavigatingTo" was firing every time you navigated to a page whether to or back. If I was navigating back to a page it would fire whilst Initialize doesn't.
This whether correct or wrong is causing me issues with some of my pages where I was passing back parameters when navigating back .
Is this the intended behavior?
thanks
OnNavigatingTo was only ever supposed to fire once. It's intent was to initialize. There ended up being cases where it fired more than once. Anything you require done once should be placed in IInitialize.Initialize anything that should be fired each time you navigate or requires some logic like Navigated Back to... should be in INavigat[ed|ion]Aware.OnNavigatedTo.
It was this confusion that led so many Prism users to request that the support be dropped and a new API be introduced that made the intent clearer.

To find which events have been fired

How one can check the list of all the fired events in Magento during a http request?
Also, there so many of them how can we check if that event has already been declared before or not.Thanks
Mage::dispatchEvent() fires 2 profiler calls. So you can enable magento profiling and it will show you all dispatched events.
Also you can look at Developer Helper extension to get list of all defined in config.xml observers.

OnBackKeyPress in windows phone only works in staring page

I need handle hardware back button in every pages but it is not working.
I can only invoke OnBackKeyPress in main page. and other pages run same functionality that I put in main page OnBackKeyPress event.
I googled it more than 2 hours but didn't find any solution.
It depends on exactly what you are doing. There are two ways to capture the Back key: override OnBackKeyPress of the PhoneApplicationPage class, or attach an event listener to RootFrame.BackKeyPress. If you are attaching an event listener then even if you leave the current page the event listener will still be attached and will be called whenever the Back key is pressed. You'll need to be more specific with exactly what you are doing, what you expect to see, and what you are seeing.

'Proceed to Checkout' Event for Magento?

I've just started putting together a Magento module which bypasses the whole Magento checkout process and instead sends the cart details to a 3rd party fulfilment company via XML-RPC.
Not getting anywhere fast and could use a bit of guidance. My understanding is that I should create the module with an observer based on the event triggered by proceeding to checkout. Trouble is I can't work out which event that would be, I've been through the whole massive list here;
http://www.nicksays.co.uk/magento_events_cheat_sheet/
I've tried;
checkout_submit_all_after - fires after order processed successfully
checkout_cart_add_product_complete - fires after product added to cart
checkout_cart_save_before - fires after product added to cart
checkout_type_onepage_save_order - can't get this to fire at all
checkout_onepage_controller_success_action - fires after order processed successfully
I don't know if this means I'll have to create a custom event or if there is an entirely different and much better alternative to what I'm doing. Building and sending the XML I will leave to another question (starting to realise I may have my hands pretty full here) but any tips there gratefully appreciated too.
Thanks for any help.
controller_action_predispatch_checkout_onepage_index should be the event you're looking for. All controllers inherit the preDispatch method which fires a generic event for predispatch, and a specific event based on the requested action path. The controller you want lives in the checkout module and is called onepage with a default action of index.
Review Mage_Core_Controller_Varien_Action::preDispatch() to see the relevant code

Resources