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
1
vote
1 answer

zend expressive layout variable

Zend expressive - Layout https://github.com/zendframework/zend-expressive-twigrenderer/issues/24 Based on this question, I want to pass a variable to layout from an Action How can I try to do that? $toast = [ 'level'=>'info', 'msg' …
1
vote
1 answer

Writing Custom Helpers in Zend Expressive 2

I'm writing a custom Helpers and everything works fine. but I have no idea how to pass parameters ... on config/autoload/templates.global.php return [ 'dependencies' => [ 'factories' => [ TemplateRendererInterface::class =>…
1
vote
2 answers

How to change or add a header in Zend Expressive

How change or add a header to the response in Zend Expressive 2 (with HtmlResponse) ? class NotModifiedMiddleware implements ServerMiddlewareInterface { /** * Process an incoming server request and return a response, optionally delegating …
Drakulitka
  • 41
  • 6
1
vote
2 answers

How can I log all requests and responses

Zend Expressive 2 I need all inputs and all outputs. My,…
user3137537
  • 61
  • 1
  • 5
1
vote
1 answer

Remove header when return response

I am using expressive 2 for a webservice, but when I return a JsonResponse it return the X-Powered-By →PHP/7.1.1 header, how to remove it from response? class ProfileAction { /** @var UsersTable */ private $usersTable; public function __construct(…
rafaelphp
  • 279
  • 2
  • 11
1
vote
0 answers

run zend expressive from subdirectory with apache .htaccess

I have been following this http://zendframework.github.io/zend-expressive/cookbook/using-a-base-path/ I have application under directory structure like this /(root) -webApp - (other directory) -public Following above guide works if i use…
varuog
  • 3,031
  • 5
  • 28
  • 56
1
vote
1 answer

Host name routing in Zend Expressive

Zend Expressive has an adapters for Aura.Router, FastRoute and zend-mvc Router and the route can match the method and path easily: get('/foo', $middleware); With zend-mvc Router component it is possible to match the hostname:
Vasil Dakov
  • 2,040
  • 2
  • 19
  • 38
1
vote
0 answers

using Dice - Dependency Injector with Zend Diactoros and Fast Route

I'm using Dice(a nice Dependency Injector) for a small project. I am also using the PSR7 Zend Diactoros for requests and nikic fast route. I got Dice working for Twig, DB and all the rest of my classes using the examples from docs, but I am unable…
user2137406
  • 41
  • 1
  • 4
1
vote
3 answers

Layout no render on some actions in Zend Expressive?

Is it possible to set layout no render in one Action (or set of Actions)? As I know I can set default layout in config, which will render on every page. I can change it in Action bay passing the 'layout' variable with value, but is it possible…
tasmaniski
  • 4,767
  • 3
  • 33
  • 65
1
vote
1 answer

inject dependency in action on form built with Zend\Form\Annotation\AnnotationBuilder with zend expressive

I am trying to replace the Zend_Db usage in the zend expressive album tutorial with doctrine. On top of this, I want to remove the album form and form factory with a form built with the zend form annotationbuilder. I get the annotationbuilder…
Lowtower
  • 25
  • 5
1
vote
2 answers

Passing data between middelware

I use zend-expressive and i would like to pass data from one middelware to another. e.g. in config/routes.php I've [ 'name' => 'v1.item.list', 'path' => '/item', 'allowed_methods' => ['GET'], 'middleware' => [ …
quentino
  • 1,101
  • 1
  • 10
  • 25
1
vote
2 answers

ZF3: set terminal / render view without layout (Zend-Expressive)

I have installed the skelleton app from ZF3 'zend-expressive'. In the routing config I have configured a few routes. Some of these routes should return a response without the layout. In ZF2 I simply used the ViewModel on which you could call…
Nykac
  • 129
  • 2
  • 7
0
votes
0 answers

Laminas filesystem cache usage

I'm trying to use file cache in my app. Steps I'm doing: require laminas/laminas-cache-storage-adapter-filesystem adding section to my autoload/cache.global.php: 'filesystem' => [ 'name' => 'filesystem', 'options' => [ …
Cawa
  • 1,269
  • 3
  • 25
  • 44
0
votes
1 answer

Slow database query with like and join

I have created a php project based on laminas and mezzio with a MySQL database to stora media files. At only 1400 media files, the search is really slow (multiple seconds for search results). My tables are user CREATE TABLE `user` ( `id` int(11)…
hapablap
  • 379
  • 6
  • 23
0
votes
0 answers

Handling gRPC requests with client-stream and/or server-stream in mezzio-swoole (PHP), is it possible?

The framework is Mezzio and the server is Swoole, both the latest version. Please note that Mezzio is just an example but Swoole is the main case. When a request is arrived, swoole onRequest event is triggered and EventDispatcher dispatches the…
1 2
3
8 9