- attach() should allow attaching a ListenerAggregate - detach() should allow detaching a ListenerAggregate - non-static implementation of StaticEventCollection - Determine how this could be injected into every class composing an EventManager? and/or those classes that ask for an EventManager? - update classes composing an EventManager such that they will set identifers when retrieved -- i.e. a setIdentifiers() call prior to returning the instance.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// The default strategy would add a listener to Application::dispatch() at high | |
// priority. This would inject a ViewModel instance with the layout template set | |
// as the template, no capture_to value, and a false terminal flag. | |
// The default strategy would also listen to Dispatchable::dispatch() at low | |
// priority; a returned ViewModel instance would be injected into the MvcEvent | |
// as the ViewModel. At this time, we'd also check for a template on the | |
// ViewModel, and if none found, auto-determine it and inject it based on the |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace FooModule; | |
use Zend\EventManager\StaticEventManager; | |
class Module | |
{ | |
public function init() | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="code_500"> | |
<h2>Application Error</h2> | |
<p> | |
An error occurred processing this page; please try again later. | |
</p> | |
<?php | |
if (!$this->display_exceptions) { | |
echo "<p>Display exceptions is disabled</p>\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div class="code_500"> | |
<h2>Application Error</h2> | |
<p> | |
An error occurred processing this page; please try again later. | |
</p> | |
<?php | |
if (!$this->display_exceptions) { | |
echo "<p>Display exceptions is disabled</p>\n"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public function getWhereParts() | |
{ | |
return array( | |
array( | |
$this->getSpecification(), | |
array($this->identifier, $this->minValue, $this->maxValue), | |
array(), | |
), | |
); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Frontend; | |
use Zend\EventManager\StaticEventManager; | |
class Module | |
{ | |
public function init() | |
{ | |
$events = StaticEventManager::getInstance(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Zend\EventManager; | |
/** | |
* EventManager can compose static connections. | |
* | |
* What I'd like to see: classes that accept an EM always get a new instance, | |
* but each EM instance each receives the *same* instance of a | |
* StaticEventCollection. | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function getEventManager() | |
{ | |
$em = new EventManager(); | |
$em->setStaticConnections($this->getGlobalEventManager()); | |
return $em; | |
} | |
function getGlobalEventManager() | |
{ |