Advertisement
Guest User

Untitled

a guest
Jul 18th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.10 KB | None | 0 0
  1.         $frontendModule[] = new Route('[<locale=cs cs|en|sk>/]'. $this->getUrl('dokumenty.default'). '[/kategorie/<category>]', [
  2.             'presenter' => 'Document',
  3.             'action' => 'default',
  4.             'category' => [
  5.                 Route::FILTER_IN => function ($slug) {
  6.                     $model = $this->container->createService('CategoryStorage');
  7.                     return $model->getIdBySlug($slug, $this->locale);
  8.                 },
  9.                 Route::FILTER_OUT => function ($id) {
  10.                     $model = $this->container->createService('CategoryStorage');
  11.                     return $model->getUrlById($id, $this->locale);
  12.                 }
  13.             ]
  14.         ]);
  15.  
  16.         $frontendModule[] = new Route('[<locale=cs cs|en|sk>/]'. $this->getUrl('blog.new') .'/[category/<category>]', [
  17.             'presenter' => 'Blog',
  18.             'action' => 'default',
  19.             'category' => [
  20.                 Route::FILTER_IN => function ($slug) {
  21.                     $model = $this->container->createService('BlogCategoryStorage');
  22.                     return $model->getCategoryIdBySlug($slug, $this->locale);
  23.                 },
  24.                 Route::FILTER_OUT => function ($id) {
  25.                     $model = $this->container->createService('BlogCategoryStorage');
  26.                     return $model->getSlugById($id, $this->locale);
  27.                 }
  28.             ]
  29.         ]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement