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
2
votes
3 answers

How to get matched route name in View - Zend Expressive

I know that I can generate URL passing the route name url('route-name') #in view file ?> But can I get information in opposite direction? From current URL/URI, I need to get route name. Real case is: I have layout.phtml where…
tasmaniski
  • 4,767
  • 3
  • 33
  • 65
1
vote
2 answers

With doctrine ODM, can I embed many subdocuments in a main document?

I try to save this JSON: { "vendorId": "vendor-fc162cdffd73", "company": { "companyId": "bcos1.company.1806cf97-a756-4fbf-9081-fc162cdffd73", "companyVersion": 1, "companyName": "Delivery Inc.", "address": { …
Peter
  • 86
  • 1
  • 6
1
vote
1 answer

Zend Expressive / Laminas Mezzio - Route expects at least parameter values

I want to use two parameters within a fast route in zend expressive / laminas mezzio. routes.php $app->get('/api/users/{userId:\d+}/pages/[{id:\d+}]', [App\Page\PageHandler::class], 'api.pages'); ConfigProvider.php [ '__class__' =>…
Daniel
  • 11
  • 1
1
vote
2 answers

How to call another internal endpoint from within zend expressive REST api application?

I am trying to call an REST api endpoint(internal) from within another method in zend expressive (PSR-7) application. Currently what I'm doing is, I send another http request like this (docs): $request = (new Zend\Diactoros\Request()) …
Sanju
  • 1,478
  • 2
  • 20
  • 41
1
vote
1 answer

Automatic type cast in zend-db

I'm using zend-db in combination with zend-expressive. I have a handler which selects all records from a database table and returns the results as JSON response: public function handle(ServerRequestInterface $request) : ResponseInterface { …
altralaser
  • 2,035
  • 5
  • 36
  • 55
1
vote
1 answer

The zend-expressive-api is all set. How can I get it to work on my apache webserver?

So I just finished the implementation of a REST API for my business client using this proposed skeleton as a start: https://github.com/ezimuel/zend-expressive-api After programming the API as I was required by my client, I managed to get it to work…
1
vote
3 answers

Zend Service Manager - Service not found exception when trying to use phpdebugbar

I'm trying to use https://github.com/php-middleware/phpdebugbar in a clean Zend Expressive Skeleton application. I know the instructions on this page suggest using this DI configuration (if using…
d.lanza38
  • 2,525
  • 7
  • 30
  • 52
1
vote
1 answer

Naming Strategy for table and column names (Doctrine ORM)

Is it possible to have a naming strategy take care of mapping table and column names in Doctrine ORM? Right now all names are specified via annotation in the entity classes, e.g.
arueckauer
  • 349
  • 5
  • 19
1
vote
0 answers

Hot to change default_suffix in zend-expressive?

I have one problem - I need to change default_suffix from phtml on something else... How I can do it? I find file where it is - \Zend\Expressive\ZendView\NamespacedPathStackResolver.php But how I can change it? I don't find where I can may write…
Auramel
  • 11
  • 1
1
vote
1 answer

Zend View behaviour in a Swoole http server

we are facing a strange behaviour with a Zend Expressive application using Zend View and running in a swoole http server. This behaviour is related with the Singleton pattern. We have configured Zend Expressive to run in a swoole http server -…
Javier Gálvez
  • 166
  • 1
  • 11
1
vote
1 answer

How to make a Test Double for the RequestHandlerInterface class in Zend Expressive using Prophesy?

I'm trying to make a unit test for the process() method of a middleware in a Zend Expressive application. To do this, I need to mock the out the $delegate parameter for the method which is of type RequestHandlerInterface and will have the method…
Knight
  • 576
  • 7
  • 19
1
vote
3 answers

Zend Expresive - EmitterException: Output has been emitted previously

I was trying to configure my website on VPS. On my local machine everything works fine, but on VPS I got 500 error. This is log: PHP message: PHP Fatal error: Uncaught Zend\HttpHandlerRunner\Exception\EmitterException: Output has been emitted…
Robin71
  • 383
  • 5
  • 26
1
vote
1 answer

How to throw 404 error in a Zend Expressive?

I have a problem. I need to throw a 404 error when I do not get a $item (see code). class HomeHandler implements RequestHandlerInterface { private $template; private $dataService; public function __construct( …
Alex Yu
  • 31
  • 6
1
vote
1 answer

Zend Input Filter "either or" scenarios is not possible?

I'm on "zendframework/zend-inputfilter" v2.8.1. Quite surprisingly for me - I wasn't able to find the configuration or setup option for next scenario: We have 2 fields, and either one or another needs to be populated. For example: we have 2 fields:…
Slayer Birden
  • 3,664
  • 2
  • 22
  • 29
1
vote
1 answer

Export to Excel error - repeat same column on this script

what is wrong on my script, export goes well but repeat the first column on all results fields. I dont want to download the file, just save it and its alright until here. Header sabe OK, but line keep the same on all 30 results. what I am doing…
1
2
3
8 9