2019-09-18 00:31:59 +02:00
|
|
|
<?php
|
|
|
|
namespace App\Gmarche;
|
|
|
|
|
|
|
|
use App\Gmarche\Actions\AntenneShowAction;
|
|
|
|
use App\Gmarche\Actions\RegionIndexAction;
|
|
|
|
use Framework\Module;
|
|
|
|
use Framework\Renderer\RendererInterface;
|
|
|
|
use Framework\Router;
|
|
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
|
|
|
|
|
|
|
|
class GmarcheModule extends Module
|
|
|
|
{
|
|
|
|
const DEFINITIONS = __DIR__ . '/config.php';
|
|
|
|
const MIGRATIONS = __DIR__ . '/db/migrations';
|
|
|
|
const SEEDS = __DIR__ . '/db/seeds';
|
|
|
|
|
|
|
|
public function __construct(ContainerInterface $container)
|
|
|
|
{
|
|
|
|
$gmarchePrefix = $container->get('gmarche.prefix');
|
|
|
|
$container->get(RendererInterface::class)->addPath('gmarche', __DIR__ . '/views');
|
|
|
|
$router = $container->get(Router::class);
|
2019-11-21 13:43:48 +01:00
|
|
|
$router->get("$gmarchePrefix", RegionIndexAction::class, 'gmarche.index');
|
|
|
|
$router->get("$gmarchePrefix{slug:[a-z\-0-9]+}", AntenneShowAction::class, 'gmarche.antenne');
|
2019-09-18 00:31:59 +02:00
|
|
|
}
|
|
|
|
}
|