(symfony事件调度程序)何时派遣事件?

时间:2015-12-24 01:58:39

标签: symfony event-dispatching

我在我的项目中使用//js to add text entries var ul = document.getElementById('list'), removeAll = document.getElementById('removeAll'), add = document.getElementById('add'); //make something happen when clicking on 'submit' add.onclick = function(){ addLi(ul); document.getElementById("titleHead"); }; //function for adding items function addLi(targetUl){ var inputText = document.getElementById('entry').value, li = document.createElement('li'), textNode = document.createTextNode(inputText + ''), removeButton = document.createElement('button'); if (inputText.split(' ').join(' ').length === 0) { //check for empty inputs alert ('No input'); return false; } removeButton.className = 'removeMe'; //add class to button for CSS removeButton.innerHTML = 'Remove'; //add text to the remove button removeButton.setAttribute('onclick', 'removeMe(this);'); li.appendChild(textNode); li.appendChild(removeButton); targetUl.appendChild(li); } //function to remove entries function removeMe(item){ var parent = item.parentElement; parent.parentElement.removeChild(parent); } removeAll.onclick = function(){ ul.innerHTML = ''; };

我的项目中有一个交易/付款系统,用户可以创建Symfony EventDispatcher,订单状态为order,当用户通过paypal支付订单时,paypal会触发一个unpaied,我的项目trade finish hook将获得支持。

所以问题是,我应该在收到挂钩时发送PayNotifyController事件,还是在将订单状态更新为pay.success之后发送?

伪代码:

paid

然后添加活动订阅者以将订单状态更新为public function hookAction() { $event->dispatch('pay.success'); }

paid

0 个答案:

没有答案
相关问题