# Mezzio

**URL:** https://discourse.laminas.dev/c/questions/mezzio/7.md

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

---

## [About the Mezzio category](https://discourse.laminas.dev/t/about-the-mezzio-category/22)

<div class="topic-metadata">

**Author:** [@matthew](https://discourse.laminas.dev/u/matthew)\
**Replies:** 0

</div>

Get help with Mezzio (formerly Expressive) applications and components here! Please restrict questions in this category to: Mezzio applications. Questions about individual Mezzio components (e.g., mezzio-platesrendere…

---

## [Generating Uri with Query and Fragment](https://discourse.laminas.dev/t/generating-uri-with-query-and-fragment/3980)

<div class="topic-metadata">

**Author:** [@mimmi20](https://discourse.laminas.dev/u/mimmi20)\
**Replies:** 1\
**Last updated:** [January 9, 2026, 6:28pm UTC](https://discourse.laminas.dev/t/generating-uri-with-query-and-fragment/3980 "2026-01-09T18:28:32Z")

</div>

Actually it is not possible to generate an Uri for a route with Query parameters or a fragment. Does anyone know why this behavior was enforced?

---

## [API - Embed object in collection? - mezzio-hal](https://discourse.laminas.dev/t/api-embed-object-in-collection-mezzio-hal/1879)

<div class="topic-metadata">

**Author:** [@MichaelB](https://discourse.laminas.dev/u/MichaelB)\
**Replies:** 5\
**Last updated:** [November 30, 2025, 12:23pm UTC](https://discourse.laminas.dev/t/api-embed-object-in-collection-mezzio-hal/1879 "2025-11-30T12:23:32Z")

</div>

Hi, I try to develop a API Rest service with mezzio and have a problem. I used https://github.com/ezimuel/zend-expressive-api from @enrico that i migrated to Mezzio for my base of structure and testing. I have a Produ…

---

## [Module Example of Mezzio](https://discourse.laminas.dev/t/module-example-of-mezzio/3944)

<div class="topic-metadata">

**Author:** [@voltan](https://discourse.laminas.dev/u/voltan)\
**Replies:** 5\
**Last updated:** [August 23, 2025, 6:53am UTC](https://discourse.laminas.dev/t/module-example-of-mezzio/3944 "2025-08-23T06:53:55Z")

</div>

Hello every one I need some repo links or example of codes, for a Mezzio modules, we have a plan to move all modules from MVC to Mezzio, I need review some examples and other developer works If you develop any module o…

---

## [Is there a way to use addGroup from FastRoute?](https://discourse.laminas.dev/t/is-there-a-way-to-use-addgroup-from-fastroute/3870)

<div class="topic-metadata">

**Author:** [@razvbir](https://discourse.laminas.dev/u/razvbir)\
**Replies:** 3\
**Last updated:** [March 17, 2025, 11:52pm UTC](https://discourse.laminas.dev/t/is-there-a-way-to-use-addgroup-from-fastroute/3870 "2025-03-17T23:52:38Z")

</div>

Hi, I’m trying to use the method FastRoute\\ConfigureRoutes::addGroup to create a group of routes. However, I noticed that this method is not exposed in the Mezzio\\Router\\RouterCollectorInterface. Is there a way to ach…

---

## [How to create module in module.config.php file?](https://discourse.laminas.dev/t/how-to-create-module-in-module-config-php-file/3860)

<div class="topic-metadata">

**Author:** [@eguvenc](https://discourse.laminas.dev/u/eguvenc)\
**Replies:** 1\
**Last updated:** [March 4, 2025, 10:53am UTC](https://discourse.laminas.dev/t/how-to-create-module-in-module-config-php-file/3860 "2025-03-04T10:53:46Z")

</div>

I downloaded the mezzio latest version. I register modules using below the command. After that the creation i could not see the module name in my module.config.php. Is this normal ? Do i have to do it by mannually ? com…

---

## [Clear-config-cache error with new Mezzo install](https://discourse.laminas.dev/t/clear-config-cache-error-with-new-mezzo-install/3820)

<div class="topic-metadata">

**Author:** [@tompin](https://discourse.laminas.dev/u/tompin)\
**Replies:** 3\
**Last updated:** [December 17, 2024, 7:58pm UTC](https://discourse.laminas.dev/t/clear-config-cache-error-with-new-mezzo-install/3820 "2024-12-17T19:58:59Z")

</div>

Hello, I’m getting the following error on a new Mezzo install. On macOS using home-brew - I have tried with PHP 8.3 and 8.4. Does anyone have an idea of the cause, please? Tom php bin/clear-config-cache.php PHP Fata…

---

## [Prevent Route Parameter Translation in Mezzio with Laminas\\I18n Integration](https://discourse.laminas.dev/t/prevent-route-parameter-translation-in-mezzio-with-laminas-i18n-integration/3822)

<div class="topic-metadata">

**Author:** [@sanjivsharmalv](https://discourse.laminas.dev/u/sanjivsharmalv)\
**Replies:** 2\
**Last updated:** [December 17, 2024, 1:43pm UTC](https://discourse.laminas.dev/t/prevent-route-parameter-translation-in-mezzio-with-laminas-i18n-integration/3822 "2024-12-17T13:43:29Z")

</div>

I am encountering an issue where the route parameter in my Mezzio application seems to be causing errors due to unintended translation behavior. Here is my route configuration for editing a Locale: // Edit Locale Route…

---

## [Installation Expressive Skeleton Application](https://discourse.laminas.dev/t/installation-expressive-skeleton-application/3807)

<div class="topic-metadata">

**Author:** [@dragon95959](https://discourse.laminas.dev/u/dragon95959)\
**Replies:** 3\
**Last updated:** [December 5, 2024, 8:50am UTC](https://discourse.laminas.dev/t/installation-expressive-skeleton-application/3807 "2024-12-05T08:50:24Z")

</div>

I’m trying to install Zend 3 (Expressive Skeleton Application) . Gives an error and does not put vendor It does not update composer 2.1.2. I have a version 2.8.3 And inside the file composer.json is not the right versi…

---

## [Are there any courses/video tutorials anywhere on Mezzio?](https://discourse.laminas.dev/t/are-there-any-courses-video-tutorials-anywhere-on-mezzio/3788)

<div class="topic-metadata">

**Author:** [@Nerji](https://discourse.laminas.dev/u/Nerji)\
**Replies:** 5\
**Last updated:** [November 2, 2024, 11:57am UTC](https://discourse.laminas.dev/t/are-there-any-courses-video-tutorials-anywhere-on-mezzio/3788 "2024-11-02T11:57:47Z")

</div>

I can’t seem to find anything current at all as far as training material goes, am I just looking in the wrong spots?

---

## [Using laminas-router regex with a Mezzio application](https://discourse.laminas.dev/t/using-laminas-router-regex-with-a-mezzio-application/3768)

<div class="topic-metadata">

**Author:** [@earthiverse](https://discourse.laminas.dev/u/earthiverse)\
**Replies:** 1\
**Last updated:** [September 20, 2024, 2:22am UTC](https://discourse.laminas.dev/t/using-laminas-router-regex-with-a-mezzio-application/3768 "2024-09-20T02:22:51Z")

</div>

I have this route set up, which works OK, but I’d like to know if it’s possible to make a route that captures /s in a parameter Right now I have return static function (Application $app): void { //... $app-\>get( sp…

---

## [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?

---

## [Question about FastRoute caching](https://discourse.laminas.dev/t/question-about-fastroute-caching/3010)

<div class="topic-metadata">

**Author:** [@wnull](https://discourse.laminas.dev/u/wnull)\
**Replies:** 2\
**Last updated:** [August 7, 2024, 10:04am UTC](https://discourse.laminas.dev/t/question-about-fastroute-caching/3010 "2024-08-07T10:04:08Z")

</div>

The question is quite simple, can I generate the FastRoute cache manually somehow, before the project starts and it starts generating everything that is configured by itself? Due to the fact that up to 30,000 thousand re…

---

## [Strange behaviour of ImplicitOptionsMiddleware with multiple route on same path](https://discourse.laminas.dev/t/strange-behaviour-of-implicitoptionsmiddleware-with-multiple-route-on-same-path/496)

<div class="topic-metadata">

**Author:** [@dominicdettabp](https://discourse.laminas.dev/u/dominicdettabp)\
**Replies:** 25\
**Last updated:** [May 5, 2018, 8:52pm UTC](https://discourse.laminas.dev/t/strange-behaviour-of-implicitoptionsmiddleware-with-multiple-route-on-same-path/496 "2018-05-05T20:52:51Z")

</div>

I’m trying to retrieve the allowed methods for a specific endpoint. The problem is when I try to do a OPTIONS request the ImplicitOptionsMiddleware match only the last route configured and retrieves the corrisponding al…

---

## [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' =\> …

---

## [CORS issue, just need verification](https://discourse.laminas.dev/t/cors-issue-just-need-verification/3692)

<div class="topic-metadata">

**Author:** [@Paul\_Allsopp](https://discourse.laminas.dev/u/Paul_Allsopp)\
**Replies:** 2\
**Last updated:** [May 17, 2024, 5:04am UTC](https://discourse.laminas.dev/t/cors-issue-just-need-verification/3692 "2024-05-17T05:04:00Z")

</div>

Hey all. I have an Angular frontend connecting to a Mezzio API and am having an issue getting my heartbeat endpoint connection working. This is a new backend, and all I’m looking for here is confirmation that my mezzio-…

---

## [Manual Wiring Arguments for Service depending on route](https://discourse.laminas.dev/t/manual-wiring-arguments-for-service-depending-on-route/3671)

<div class="topic-metadata">

**Author:** [@hfehderau](https://discourse.laminas.dev/u/hfehderau)\
**Replies:** 10\
**Last updated:** [April 30, 2024, 3:09pm UTC](https://discourse.laminas.dev/t/manual-wiring-arguments-for-service-depending-on-route/3671 "2024-04-30T15:09:29Z")

</div>

Hello everyone and thank you for your time reading that. I have two different routes, which are described via ConfigProvider, and two middlewares inside: Auth Handler The behavior for both of them should be exactly t…

---

## [Unable to use formLabel helpers in Mezzio / Twig](https://discourse.laminas.dev/t/unable-to-use-formlabel-helpers-in-mezzio-twig/3664)

<div class="topic-metadata">

**Author:** [@sanjivsharmalv](https://discourse.laminas.dev/u/sanjivsharmalv)\
**Replies:** 1\
**Last updated:** [April 21, 2024, 12:55am UTC](https://discourse.laminas.dev/t/unable-to-use-formlabel-helpers-in-mezzio-twig/3664 "2024-04-21T00:55:09Z")

</div>

My App Config Provider has $aggregator = new ConfigAggregator(\[ ... ... ... \\Laminas\\Form\\ConfigProvider::class, ... But still I get the following error: Unknown “formLabel” function. When I try to use formLabel…

---

## [How do I configure Doctrine with Mezzio](https://discourse.laminas.dev/t/how-do-i-configure-doctrine-with-mezzio/3647)

<div class="topic-metadata">

**Author:** [@sanjivsharmalv](https://discourse.laminas.dev/u/sanjivsharmalv)\
**Replies:** 2\
**Last updated:** [March 26, 2024, 3:53am UTC](https://discourse.laminas.dev/t/how-do-i-configure-doctrine-with-mezzio/3647 "2024-03-26T03:53:23Z")

</div>

My global.php has: return \[ 'doctrine' =\> \[ 'connection' =\> \[ 'orm\_default' =\> \[ 'driverClass' =\> PDOMySqlDriver::class, 'params' =\> \[ …

---

## [Using Twig renderer gives error:There are no registered paths for namespace "app"](https://discourse.laminas.dev/t/using-twig-renderer-gives-error-there-are-no-registered-paths-for-namespace-app/3643)

<div class="topic-metadata">

**Author:** [@sanjivsharmalv](https://discourse.laminas.dev/u/sanjivsharmalv)\
**Replies:** 1\
**Last updated:** [March 19, 2024, 4:43pm UTC](https://discourse.laminas.dev/t/using-twig-renderer-gives-error-there-are-no-registered-paths-for-namespace-app/3643 "2024-03-19T16:43:35Z")

</div>

Following shows how I tried to use Twig renderer in my Mezzio app: \<?php declare(strict\_types=1); namespace App\\Login; use Mezzio\\Twig\\TwigRenderer; use Psr\\Container\\ContainerInterface; class LoginHandlerFactory { …

---

## [Using array of middlewares for a route gives error](https://discourse.laminas.dev/t/using-array-of-middlewares-for-a-route-gives-error/3631)

<div class="topic-metadata">

**Author:** [@sanjivsharmalv](https://discourse.laminas.dev/u/sanjivsharmalv)\
**Replies:** 16\
**Last updated:** [March 19, 2024, 12:27pm UTC](https://discourse.laminas.dev/t/using-array-of-middlewares-for-a-route-gives-error/3631 "2024-03-19T12:27:33Z")

</div>

Following works: $app-\>route(‘/login’, \[App\\Session\\InitSessionMiddleware::class\],\[‘GET’, ‘POST’\], ‘login’); But the following gives error(“Illegal offset type in isset or empty”): $app-\>route(‘/login’, \[App\\Session\\…

---

## [Routes - '/api/ping' and '/login' always return 404 'Not Found'](https://discourse.laminas.dev/t/routes-api-ping-and-login-always-return-404-not-found/3634)

<div class="topic-metadata">

**Author:** [@sanjivsharmalv](https://discourse.laminas.dev/u/sanjivsharmalv)\
**Replies:** 12\
**Last updated:** [March 19, 2024, 12:24pm UTC](https://discourse.laminas.dev/t/routes-api-ping-and-login-always-return-404-not-found/3634 "2024-03-19T12:24:24Z")

</div>

1.LoginHandler is registered with ConfigProvider of App: public function getDependencies(): array { return \[ 'invokables' =\> \[ Handler\\PingHandler::class =\> Handler\\PingHandler::…

---

## [Debuggin in Mezzio](https://discourse.laminas.dev/t/debuggin-in-mezzio/3625)

<div class="topic-metadata">

**Author:** [@sanjivsharmalv](https://discourse.laminas.dev/u/sanjivsharmalv)\
**Replies:** 5\
**Last updated:** [March 14, 2024, 10:56pm UTC](https://discourse.laminas.dev/t/debuggin-in-mezzio/3625 "2024-03-14T22:56:57Z")

</div>

What is the var\_dump() equivalent in Mezzio. Or how do log messages in messeges in Mezzio for debug purposes.

---

## [Where is Session ContainerPersistenceInterface?](https://discourse.laminas.dev/t/where-is-session-containerpersistenceinterface/3623)

<div class="topic-metadata">

**Author:** [@wscp](https://discourse.laminas.dev/u/wscp)\
**Replies:** 2\
**Last updated:** [March 8, 2024, 8:49am UTC](https://discourse.laminas.dev/t/where-is-session-containerpersistenceinterface/3623 "2024-03-08T08:49:09Z")

</div>

I was looking at the mezzio-session docs and noticed this part about using SessionContainerPersistenceInterface to handle session expiry in custom persistence backends. However, I can’t find any information about Session…

---

## [Mezzio Navigation](https://discourse.laminas.dev/t/mezzio-navigation/3373)

<div class="topic-metadata">

**Author:** [@Stefan81](https://discourse.laminas.dev/u/Stefan81)\
**Replies:** 6\
**Last updated:** [January 14, 2024, 2:38pm UTC](https://discourse.laminas.dev/t/mezzio-navigation/3373 "2024-01-14T14:38:31Z")

</div>

Hi everyone, I’m currently working on a Mezzio app and I’m trying to figure out how to use laminas-navigation to create a navigation system. I’ve been looking at the documentation, but I’m still not sure how to do it. …

---

## [How to init Database connection in phpunit Functional test](https://discourse.laminas.dev/t/how-to-init-database-connection-in-phpunit-functional-test/3503)

<div class="topic-metadata">

**Author:** [@rolek](https://discourse.laminas.dev/u/rolek)\
**Replies:** 2\
**Last updated:** [October 18, 2023, 7:13pm UTC](https://discourse.laminas.dev/t/how-to-init-database-connection-in-phpunit-functional-test/3503 "2023-10-18T19:13:44Z")

</div>

Hi everyone! I’m trying to write some functional tests for my application. I found this post Mezzio Example: Functional and Unit Testing - Marc Guyer which got me started somewhat, but the problem I’m having is that whe…

---

## [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;…

---

## [Mezzio swoole high cpu usage on start](https://discourse.laminas.dev/t/mezzio-swoole-high-cpu-usage-on-start/3435)

<div class="topic-metadata">

**Author:** [@Vinith\_Mathews](https://discourse.laminas.dev/u/Vinith_Mathews)\
**Replies:** 2\
**Last updated:** [August 16, 2023, 8:51am UTC](https://discourse.laminas.dev/t/mezzio-swoole-high-cpu-usage-on-start/3435 "2023-08-16T08:51:12Z")

</div>

I am running mezzio swoole application in production in aws. Recently my local installation of the production version which was served on localhost:9501 started not to respond (no change made to the code, except composer…

---

## [How can I prevent layout from rendering by default, yet still be able to turn layout rendering on by declaring it explicitly?](https://discourse.laminas.dev/t/how-can-i-prevent-layout-from-rendering-by-default-yet-still-be-able-to-turn-layout-rendering-on-by-declaring-it-explicitly/1052)

<div class="topic-metadata">

**Author:** [@dennis-fedco](https://discourse.laminas.dev/u/dennis-fedco)\
**Replies:** 5\
**Last updated:** [August 6, 2023, 8:42pm UTC](https://discourse.laminas.dev/t/how-can-i-prevent-layout-from-rendering-by-default-yet-still-be-able-to-turn-layout-rendering-on-by-declaring-it-explicitly/1052 "2023-08-06T20:42:07Z")

</div>

I often use template-\>render() to generate HTML snippets. By default they are generated with a full layout. This is something I do not want. My two use cases are AJAX requests where I only need to generate a bit of te…

---

## [Laminas,Mezzio security](https://discourse.laminas.dev/t/laminas-mezzio-security/3390)

<div class="topic-metadata">

**Author:** [@Stefan81](https://discourse.laminas.dev/u/Stefan81)\
**Replies:** 1\
**Last updated:** [July 12, 2023, 9:45pm UTC](https://discourse.laminas.dev/t/laminas-mezzio-security/3390 "2023-07-12T21:45:01Z")

</div>

Hi everyone, I’m wondering if there are already solution for security issues with the Mezzio framework. I’m interested in CSRF, XSS, and Excel injection vulnerabilities. Are there any CSRF, XSS, or CSV injection (CSV I…

[Next page](https://discourse.laminas.dev/c/questions/mezzio/7.md?page=1)
