# \#laminas-router

**URL:** https://discourse.laminas.dev/tag/laminas-router/90.md

[Latest](https://discourse.laminas.dev/latest.md) · [Categories](https://discourse.laminas.dev/categories.md) · [Tags](https://discourse.laminas.dev/tags.md)

---

## [Skip optional Route-Params](https://discourse.laminas.dev/t/skip-optional-route-params/3777)

<div class="topic-metadata">

**Author:** [@MaSa759](https://discourse.laminas.dev/u/MaSa759)\
**Replies:** 6\
**Last updated:** [October 2, 2024, 10:49pm UTC](https://discourse.laminas.dev/t/skip-optional-route-params/3777 "2024-10-02T22:49:14Z")

</div>

Hi, I want to set up different languages for my application. Therefore I configured my routes like this: \[ 'type' =\> 'segment', 'options' =\> \[ 'route' =\> '\[/:lang\]/', 'defau…

---

## [How to configure the TranslatorAwareTreeRouteStack within Mezzio?](https://discourse.laminas.dev/t/how-to-configure-the-translatorawaretreeroutestack-within-mezzio/3579)

<div class="topic-metadata">

**Author:** [@mimmi20](https://discourse.laminas.dev/u/mimmi20)\
**Replies:** 2\
**Last updated:** [August 11, 2024, 5:49pm UTC](https://discourse.laminas.dev/t/how-to-configure-the-translatorawaretreeroutestack-within-mezzio/3579 "2024-08-11T17:49:57Z")

</div>

I want to use the TranslatorAwareTreeRouteStack within Mezzio to have local paths. Does anyone know, how to configure this?

---

## [Mezzio routes autowiring not working with delegators in a module](https://discourse.laminas.dev/t/mezzio-routes-autowiring-not-working-with-delegators-in-a-module/3701)

<div class="topic-metadata">

**Author:** [@ALTAMASH80](https://discourse.laminas.dev/u/ALTAMASH80)\
**Replies:** 5\
**Last updated:** [May 20, 2024, 6:09pm UTC](https://discourse.laminas.dev/t/mezzio-routes-autowiring-not-working-with-delegators-in-a-module/3701 "2024-05-20T18:09:49Z")

</div>

Hi, I’m trying to autowire routes as suggested in the docs here. My config provider class is as follows. class ConfigProvider { public function \_\_invoke(): array { return \[ 'dependencies' =\> …

---

## [A project pointed by many domain, dispatch to different module, and one domain is action as a parent domain](https://discourse.laminas.dev/t/a-project-pointed-by-many-domain-dispatch-to-different-module-and-one-domain-is-action-as-a-parent-domain/3508)

<div class="topic-metadata">

**Author:** [@jobsfan](https://discourse.laminas.dev/u/jobsfan)\
**Replies:** 4\
**Last updated:** [October 26, 2023, 1:54am UTC](https://discourse.laminas.dev/t/a-project-pointed-by-many-domain-dispatch-to-different-module-and-one-domain-is-action-as-a-parent-domain/3508 "2023-10-26T01:54:41Z")

</div>

A little hard to descripe my situation, I am trying. Assume that I have many domain, like www.parent.com, www.child1.com, www.child2.com… One parent and many many child, the domain is totally different, call it parent …

---

## [Laminas routing for controller route not working](https://discourse.laminas.dev/t/laminas-routing-for-controller-route-not-working/3489)

<div class="topic-metadata">

**Author:** [@Aleksandr\_Zamiatin](https://discourse.laminas.dev/u/Aleksandr_Zamiatin)\
**Replies:** 3\
**Last updated:** [October 6, 2023, 10:57am UTC](https://discourse.laminas.dev/t/laminas-routing-for-controller-route-not-working/3489 "2023-10-06T10:57:46Z")

</div>

I’m trying to add new controller and routes for it in laminas, I have some stracture of module like this: https://i.stack.imgur.com/tOts6.png ConfigProvider contains: \<?php declare(strict\_types=1); namespace RoleApi;…

---

## [Solved! Child route with hostname parent route, wrong in url built-in viewhelper](https://discourse.laminas.dev/t/solved-child-route-with-hostname-parent-route-wrong-in-url-built-in-viewhelper/3394)

<div class="topic-metadata">

**Author:** [@jobsfan](https://discourse.laminas.dev/u/jobsfan)\
**Replies:** 4\
**Last updated:** [August 1, 2023, 8:33am UTC](https://discourse.laminas.dev/t/solved-child-route-with-hostname-parent-route-wrong-in-url-built-in-viewhelper/3394 "2023-08-01T08:33:48Z")

</div>

route defined in module.config.php as follow: 'router' =\> \[ 'routes' =\> \[ 'searchtop' =\> \[ 'type' =\> Hostname::class, 'options' =\> \[ 'route' =\> ':subdomain.:maindomain', 'constraints' =\> \[ 'subdoma…

---

## [Router not displaying views](https://discourse.laminas.dev/t/router-not-displaying-views/3192)

<div class="topic-metadata">

**Author:** [@AzafoCossa](https://discourse.laminas.dev/u/AzafoCossa)\
**Replies:** 6\
**Last updated:** [April 11, 2023, 5:13am UTC](https://discourse.laminas.dev/t/router-not-displaying-views/3192 "2023-04-11T05:13:28Z")

</div>

Hi everyone! I am trying to set up a basic routing in my system, but it seems not to work. The application loads fine, no errors are displayed. Here is module.config.php file. use Application\\Controller\\CustomersCont…

---

## [Question about router, Middleware and handler](https://discourse.laminas.dev/t/question-about-router-middleware-and-handler/2813)

<div class="topic-metadata">

**Author:** [@voltan](https://discourse.laminas.dev/u/voltan)\
**Replies:** 0\
**Last updated:** [March 14, 2022, 6:19am UTC](https://discourse.laminas.dev/t/question-about-router-middleware-and-handler/2813 "2022-03-14T06:19:49Z")

</div>

Hello I worked on some modules via laminas MVC and Middleware, I needed some parameters like validator name for request or permission for each handler to manage RBAC and same. I put all of them in route default options…

---

## [Configure route to accept only pont](https://discourse.laminas.dev/t/configure-route-to-accept-only-pont/2781)

<div class="topic-metadata">

**Author:** [@Andre\_Medeiros](https://discourse.laminas.dev/u/Andre_Medeiros)\
**Replies:** 1\
**Last updated:** [February 22, 2022, 12:50pm UTC](https://discourse.laminas.dev/t/configure-route-to-accept-only-pont/2781 "2022-02-22T12:50:27Z")

</div>

Hello friends it is possible to configure the method validation in the segment type route. For example, I need my route to only accept POST methods. My route is like this 'router' =\> \[ 'routes' =\> \[ …

---

## [HTTP Routing options](https://discourse.laminas.dev/t/http-routing-options/2761)

<div class="topic-metadata">

**Author:** [@Francisc\_Tar](https://discourse.laminas.dev/u/Francisc_Tar)\
**Replies:** 7\
**Last updated:** [February 16, 2022, 12:43pm UTC](https://discourse.laminas.dev/t/http-routing-options/2761 "2022-02-16T12:43:40Z")

</div>

I have the following options in my HTTP route configuration 'options' =\> \[ 'route' =\> '\[:4th.\]:3rd.:2nd.\[:1st\]', 'constraints' =\> \[ '4th' =\> '.\*?', '3rd' =\> 'mydomain', '2nd' =\> 'com', '1st' =\> '.\*?', \], \]…

---

## [How to retrieve all available routes in an application?](https://discourse.laminas.dev/t/how-to-retrieve-all-available-routes-in-an-application/2668)

<div class="topic-metadata">

**Author:** [@Koen1999](https://discourse.laminas.dev/u/Koen1999)\
**Replies:** 0\
**Last updated:** [December 24, 2021, 1:43pm UTC](https://discourse.laminas.dev/t/how-to-retrieve-all-available-routes-in-an-application/2668 "2021-12-24T13:43:22Z")

</div>

I want to quickly improve test coverage for my project by doing some basic tests. In specific, I had the idea to test whether all Controller actions return a non-500 status code since this is something that all actions s…

---

## [How to add a base path to all routes?](https://discourse.laminas.dev/t/how-to-add-a-base-path-to-all-routes/2125)

<div class="topic-metadata">

**Author:** [@renanliberato](https://discourse.laminas.dev/u/renanliberato)\
**Replies:** 9\
**Last updated:** [February 25, 2021, 7:40am UTC](https://discourse.laminas.dev/t/how-to-add-a-base-path-to-all-routes/2125 "2021-02-25T07:40:07Z")

</div>

Hello! I’m deploying a laminas app in a subfolder under my domain (https://renanliberato.com.br/myapp), and I don’t know exactly how to deal with this “/myapp” prefix on my app. Currently, I’m adding this base path int…

---

## [Warning in laminas\\laminas-router regex](https://discourse.laminas.dev/t/warning-in-laminas-laminas-router-regex/2129)

<div class="topic-metadata">

**Author:** [@matthieu-antoniol](https://discourse.laminas.dev/u/matthieu-antoniol)\
**Replies:** 5\
**Last updated:** [February 24, 2021, 6:35pm UTC](https://discourse.laminas.dev/t/warning-in-laminas-laminas-router-regex/2129 "2021-02-24T18:35:40Z")

</div>

Hello, I’m currently migrating from old zend framework to laminas. I have been lead to use laminas-router. Since i installed the library in version 3.4.4 (latest stable if i’m not wrong), I have been having the follow…

---

## [Blog post: how to configure a global module route](https://discourse.laminas.dev/t/blog-post-how-to-configure-a-global-module-route/2123)

<div class="topic-metadata">

**Author:** [@renanliberato](https://discourse.laminas.dev/u/renanliberato)\
**Replies:** 0\
**Last updated:** [February 21, 2021, 5:21pm UTC](https://discourse.laminas.dev/t/blog-post-how-to-configure-a-global-module-route/2123 "2021-02-21T17:21:03Z")

</div>

Hi everyone! I wrote a small post about configuring a Segment route to serve a whole module. I hope it helps you someday!
