/** * Method to be called on the way into the filter. * * If not already provided, this method will add a default * Proem\Api\Dispatch\Template implementation to the main service * manager under the index of *dispatch*. * * @see Proem\Api\Dispatch\Template * @param Proem\Api\Service\Manager\Template */ public function inBound(Manager $assets) { if (!$assets->provides('Proem\\Dispatch\\Template')) { $asset = new Asset(); $assets->set('dispatch', $asset->set('Proem\\Dispatch\\Template', $asset->single(function () use($assets) { return new DispatchStandard($assets); }))); } }
/** * Method to be called on the way into the filter. * * If not already provided, this method will add a default * Proem\Api\IO\Response\Template implementation to the main service * manager under the index of *response*. * * @param Proem\Api\Service\Manager\Template $assets */ public function inBound(Manager $assets) { if (!$assets->provides('Proem\\IO\\Response\\Template')) { $asset = new Asset(); $assets->set('response', $asset->set('Proem\\IO\\Response\\Template', $asset->single(function () { return new HTTPResponse(); }))); } }
/** * Method to be called on the way into the filter. * * This method is responsible for setting up the default routes. * * @param Proem\Service\Manager\Template $assets */ public function inBound(Manager $assets) { if (!$assets->provides('Proem\\Routing\\Router\\Template')) { $asset = new Asset(); $assets->set('router', $asset->set('Proem\\Routing\\Router\\Template', $asset->single(function () use($assets) { return new Router($assets->get('request')); }))); } }
/** * Method to be called on the way into the filter. * * This method is responsible for setting up the default routes. * * @param Proem\Api\Service\Manager\Template $assets */ public function inBound(Manager $assets) { if (!$assets->provides('Proem\\Routing\\Router\\Template')) { $asset = new Asset(); $assets->set('router', $asset->set('Proem\\Routing\\Router\\Template', $asset->single(function () use($assets) { $router = (new Router($assets->get('request')))->attach('default-module-controller-action-params', new StandardRoute(['rule' => '/:module/:controller/:action/:params']))->attach('default-module-controller-action-noparams', new StandardRoute(['rule' => '/:module/:controller/:action']))->attach('default-module-controller-noaction', new StandardRoute(['rule' => '/:module/:controller', 'targets' => ['action' => 'index']]))->attach('default-nomodule-controller-action', new StandardRoute(['rule' => '/:controller/:action', 'targets' => ['module' => 'index']]))->attach('default-module-nocontroller', new StandardRoute(['rule' => '/:module', 'targets' => ['controller' => 'index', 'action' => 'index']]))->attach('default-nomodule-controller', new StandardRoute(['rule' => '/:controller', 'targets' => ['module' => 'index', 'action' => 'index']]))->attach('default-params', new StandardRoute(['rule' => '/:params', 'targets' => ['module' => 'index', 'controller' => 'index', 'action' => 'index']]))->attach('default-noparams', new StandardRoute(['rule' => '/', 'targets' => ['module' => 'index', 'controller' => 'index', 'action' => 'index']])); return $router; }))); } }