Questions tagged [mezzio]

Mezzio is a web application and API framework written in PHP and using standards-based middleware.

Mezzio, formerly Expressive, is a web application and API framework written in PHP and using standards-based middleware. It consumes request handlers and middleware, using HTTP messages.

Mezzio is a sub-project of the project.

123 questions
0
votes
1 answer

Define global constant with mezzio swoole/openswoole

im trying to set a global constant that would be accessible to all php swoole processes and threads later, but it seems to be not visible or something Here's my index.php - almost vanilla mezzio - I only see APPROOT constant: (function () { if…
Dannyboy
  • 1,963
  • 3
  • 20
  • 37
0
votes
0 answers

Mezzio app works fine on built-in php server but gives error when run in docker container

I've got a Mezzio application that works perfectly on built-in php server using compoer serve, however, when I try it in docker environment, it gives me following error. Fatal error: Uncaught Laminas\View\Exception\RuntimeException:…
GoharSahi
  • 488
  • 1
  • 8
  • 22
0
votes
2 answers

How to implement PHP UnitTest using getMockBuilder() for a custom service?

I'm trying to write a PHP UnitTest for my AddHandler::class in Mezzio (Zend Expressive) but I'm not sure I've done it right or wrong. Although the Test passes but I'm not really convinced that's the way to do it. The requirement is to basically mock…
GoharSahi
  • 488
  • 1
  • 8
  • 22
0
votes
1 answer

Access the set data for logic in Laminas filter?

I am using Mezzio/Laminas (newer version of Zend) and want to check whether an id is less than a number. If it is not, another form element is required. Is it possible to access the set data in a laminas-filter in any way?
OCHnITRI
  • 5
  • 2
0
votes
1 answer

load different methods from a single class with multiple routes in laminas mezzio

I am trying to route to a single class and load different methods within that class. Right now i can only manage to load handle() inside SearchInquiryHandler class. How can i also load loadThisMethod() inside SearchInquiryHandler from a different…
black
  • 729
  • 5
  • 13
  • 28
0
votes
3 answers

Download CSV in Mezzio Framework (Zend/Laminas)

In Mezzion Framework I have the next Handler:
Peter
  • 86
  • 1
  • 6
0
votes
1 answer

Mezzio: How can I use subdomains in routes?

So, I have several subdomains for my project with mezzio framework (zend expressive): example.com journal.example.com account.example.com How can I use it in routes? This example does not work: $app->get('journal.example.com',…
Nepster
  • 144
  • 6
0
votes
1 answer

Mezzio skeleton application on Centos 8

I try to run a Mezzio application on my server I do the following steps : - Create a Mezzio project composer create-project mezzio/mezzio-skeleton symphonie I choose modular application, fast router, service manager, plates renderer and Whoops I…
shishi
  • 28
  • 4
0
votes
1 answer

Pass options to ClassMethodsHydrator in zend-expressive-hal config

I use zend-expressive-hal (v3) and have the following config written for the delivery of my User class: return [ [ '__class__' => RouteBasedResourceMetadata::class, 'resource_class' => Handler\User::class, 'route' =>…
altralaser
  • 2,035
  • 5
  • 36
  • 55
0
votes
1 answer

How can Ideploying APIs created in zend expressive in aws lambda?

I have created a Zend expressive application that basically exposes a few APIs. I want to deploy this now to AWS Lambda. What is the best way to refactor the code quickly and easily (or is there any other alternatives) to deploy it? I am fairly new…
Md Monjur Ul Hasan
  • 1,705
  • 1
  • 13
  • 36
0
votes
0 answers

PHP/MongoDB - Doctrine ODM Hydrate in some cases others not

I need some help in Doctrine ODM, in some cases the hydrate do not return the expected values. I have on project as example and when I query for a collection and all work fine with hydrate, this is the case that…
0
votes
1 answer

Split route configuration in zend-expressive

I'm using zend-expressive (3) to build my REST APIs. The file config/routes.php contains my routes, e.g. return function (Application $app, MiddlewareFactory $factory, ContainerInterface $container) : void { $app->get('/',…
altralaser
  • 2,035
  • 5
  • 36
  • 55
0
votes
2 answers

Doctrine ORM Issue: [Semantical Error] The annotation does not exist, or could not be auto-loaded

Issue I am encountering as of the moment. Error Encounter: [Semantical Error] The annotation "@Doctrine\ORM\Mapping\Id_users" in property Users\Entity\User::$id_users does not exist, or could not be auto-loaded. My Entity PHP…
tom_cruz
  • 411
  • 1
  • 6
  • 15
0
votes
2 answers

How to get Request object outside of Handler in Zend Expressive 3

I would like to access request object outside of the handler. What I'm trying to achieve, is to have a factory class, which based on the values from the request, will setup some class. Unfortunately code below (in the factory class) doesn't provide…
Pawel
  • 466
  • 1
  • 7
  • 20
0
votes
1 answer

Cannot generate HalResource for object of type ArrayObject

I've some problems to return a paginator object as HAL json collection. I'm using the latest versions of zend-expressive and zend-expressive-hal. This is the setting from my ConfigProvider: public function __invoke() : array { return [ …
altralaser
  • 2,035
  • 5
  • 36
  • 55
1 2 3
8 9