gmarche/src/Framework/Router/RouterFactory.php

19 lines
351 B
PHP

<?php
namespace Framework\Router;
use Framework\Router;
use Psr\Container\ContainerInterface;
class RouterFactory
{
public function __invoke(ContainerInterface $container)
{
$cache = null;
if ($container->get('env') === 'production') {
$cache = 'tmp/routes';
}
return new Router($cache);
}
}