- How to properly handle a doctrine entity manager on an expressive application served with swoole
Some of you probably know that I have a pet project in which I like to work from time to time. This project is a self-hosted URL shortener called Shlink. Shlink is built using expressive as the base framework for the HTTP-dispatching task. A while ago, an expressive module was released to officially…
tag Archive — "zend-expressive"
— 2019 —
— 2017 —
- How to customize 'not found' and 'method not allowed' response prototypes in Zend expressive 2
Sometimes the nature of an application requires you to change the default framework's way to structure error responses (like 404 and 405). On this article I'm going to explain how to customize those responses when working with Zend Expressive 2. Expressive 1. Error handler. In Expressive 1, error ha…
- My thoughts after migrating some projects to Zend Expressive 2
The day Zend Expressive 2 was released I was super excited. I have been using it a lot for both professional and personal projects, so I'm quite used to it. Since I've been using it in many projects, being able to update all of them to version 2 was a challenge, but I can say, I have succeeded :-) T…
- Managing PUT requests with file uploads in psr-7 and middleware PHP applications
It has been a long time since I first realized that handling file uploads in non-POST requests (like PUT) wasn't an easy task. One could assume the $_FILES array should be populated regardless the HTTP verb, but actually, PHP doesn't do it on its own. After a long time wanting to find a solution to …
— 2016 —
- Creating a content-based Error Handler for Zend Expressive
The other day I was working on a Zend Expressive application I'm currently building. The application includes a REST API among other things, but it also has some endpoints which render HTML. In one of my tests of the REST API I saw that when an error occurs (404, 405 or 500), I was getting an HTML r…
- Project Scalability with Zend Expressive
I've been working with some different frameworks lately. One of them is Zend Expressive, and I've come to the conclusion that I don't need to choose between different frameworks; depending on the project, Expressive always fits my needs and scales from small projects to bigger applications. The Micr…
- Dispatch REST-like requests with a single controller class in Zend Expressive
I was digging into Zend Expressive and how to use controllers that allow me to share dependencies between different routes, instead of having to use different middlewares every time. Abdul wrote a great article on this subject that you can find here, which also became part of Expressive's cookbook s…
— 2015 —
- My first approach to Zend Expressive
One of the trending topics in the PHP world nowadays is the one about microframeworks. It started some years ago with Slim and Silex, but recently it has been an explossion of new microframeworks. First, Slim's team announced the third version of its own framework, which implemented the psr-7 HTTP s…