You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.
When creating an Expressive driven modular application it makes module specific routes easier to maintain. (Not sure of the implications for a flat application.)
What are the thoughts of including this in the skeleton starting with v3?
So, other than adding the 'delegators' key to the ConfigProvider.php as part of the getDependencies() return, we could add the RouteDelegator.php with something like:
namespace App;
use App\Handler;
use Psr\Container\ContainerInterface;
use Zend\Expressive\Application;
class RoutesDelegator
{
/**
* @param ContainerInterface $container
* @param string $serviceName Name of the service being created.
* @param callable $callback Creates and returns the service.
* @return Application
*/
public function __invoke(ContainerInterface $container, $serviceName, callable $callback)
{
/** @var $app Application */
$app = $callback();
// Setup routes:
$app->get('/', Handler\HomePageHandler::class, 'home');
$app->get('/api/ping', Handler\PingHandler::class, 'api.ping');
return $app;
}
}
As requested by @adamculp
For details and brief discussion see zendframework/zend-expressive-skeleton#223
The text was updated successfully, but these errors were encountered: