2019-09-18 00:31:59 +02:00
|
|
|
<?php
|
|
|
|
namespace App\Product;
|
|
|
|
|
|
|
|
use App\Product\Actions\ProductIndexAction;
|
2019-10-26 01:42:50 +02:00
|
|
|
use App\Product\Actions\RechIndexAction;
|
2019-09-18 00:31:59 +02:00
|
|
|
use Framework\Module;
|
|
|
|
use Framework\Renderer\RendererInterface;
|
|
|
|
use Framework\Router;
|
|
|
|
use Psr\Container\ContainerInterface;
|
|
|
|
|
|
|
|
class ProductModule extends Module
|
|
|
|
{
|
|
|
|
const DEFINITIONS = __DIR__ . '/config.php';
|
|
|
|
const MIGRATIONS = __DIR__ . '/db/migrations';
|
|
|
|
const SEEDS = __DIR__ . '/db/seeds';
|
|
|
|
|
|
|
|
public function __construct(ContainerInterface $container)
|
|
|
|
{
|
2019-11-23 17:18:44 +01:00
|
|
|
$gmarchePrefix = $container->get('gmarche.prefix').'france/';
|
2019-09-18 00:31:59 +02:00
|
|
|
|
|
|
|
$container->get(RendererInterface::class)->addPath('product', __DIR__ . '/views');
|
|
|
|
$router = $container->get(Router::class);
|
2019-11-21 14:16:02 +01:00
|
|
|
$router->get("$gmarchePrefix{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/produits", ProductIndexAction::class, 'product.ville');
|
|
|
|
$router->get("$gmarchePrefix{region:[a-z\-0-9]+}/{slug:[a-z\-0-9]+}/recherches", RechIndexAction::class, 'product.recherches');
|
2019-09-18 00:31:59 +02:00
|
|
|
}
|
|
|
|
}
|