148 questions
0 votes
1 answer
91 views
Zend Framework 1.2 - Error Table doesn't exists - even though the table already exists in MySQL
We’re on Zend 1.12 https://github.com/Shardj/zf1-future with security and php7.4 compatibility updates. Since this is a legacy application with very little documentation from the prior developer. I am ...
0 votes
1 answer
554 views
Laminas: Different Layout Files for each Module
i would like to use a different layout file for each module which is set under view_manager- template_mapin the module.config.php But for some reason both modules are always using the same Layout File....
0 votes
3 answers
2k views
How to pass variables from controller to layout (not view) in Zend 3
I'm using zend MVC 3.1.1 and trying to pass variables from the called controller action to the layout but having real difficulties finding a way to do so. I haven't found a solution online for this ...
3 votes
2 answers
769 views
Loading Modules Dynamically in Zend Framework 2
I have asked this question yesterday as well, but this one includes code. Issue My application have multiple modules and 2 types of user accounts, Some modules are loaded always which are present in ...
0 votes
0 answers
138 views
tablegateway in Zend3 vs Model in Zend1
In the last years I developed a few projects in ZF1.x. Now I started a new one and used ZF3 the first time. I found some very good improvements, but I'm a bit lost with the database models. What is ...
0 votes
1 answer
193 views
Passing variables between Middlewares using zend-mvc
I'm trying to decipher how to properly blend variables between ZF3 Middleware under the latest release of zend-mvc. Imagine a route like this: 'sandwich-test' => [ 'type' => \Zend\Router\...
1 vote
1 answer
889 views
Ignoring the default 404 route in ZF3 MVC
Currently, for my GET endpoints in RESTFUL Zend Framework 3, if I can't find the item the user requests through the paramaters I send 400 with JSON API errors like so: $this->response->...
1 vote
2 answers
472 views
What's the best way to make a ZF3 application with no default router?
I made a Zend Framework 3 MVC application. I don't want a default router. My one controller RESTFUL and only returning JSON. I want to remove the default IndexController. I want / to just give a 404 ...
0 votes
1 answer
565 views
Can I have a ZF3 MVC Framework Controller with parameters in the constructor?
I have a Zend Framework 3 MVC app with a controller with two end points. Both need to access the same class. It seems like the best way to do this would be to would be to make an instance of this ...
1 vote
1 answer
310 views
How do I configure the default ZendLog factory for a Zend Framework MVC app?
I have a ZendFramework application. Its running Zend Framework 3. I added zend-log, and injected it into the constructor of the IndexController I log a message in the index action of the index ...
3 votes
1 answer
868 views
Making a Zend Framework 3 MVC app return a simple string
I have a ZF MVC app I created with composer create-project -sdev zendframework/skeleton-application my-application I made a controller like the following. class SomeController extends ...
0 votes
1 answer
136 views
Zend Project architecture
I'm currently using Zend 3 for a project (or a range of projects). In order to avoid multiple vendor folders per project, I'd like to have ONE vendor folder at root level that every project runs from. ...
8 votes
2 answers
6k views
ServiceManager in ZF3
I know that this has been covered extensively in other threads, but I'm struggling to work out how to replicate the effect of $this->getServiceLocator() from ZF2 controllers in ZF3 ones. I have tried ...
1 vote
1 answer
988 views
Serializing objects to ZF3 MVC Response JSON
I have a Zend Framework 3 app. I added the ViewJsonStrategy to module.config.php. This lets the following endpoint return JSON: public function helloAction() { return new JsonModel([ 'msg'...
3 votes
1 answer
165 views
zf2 routing seems to ignore __NAMESPACE__
In Zend Framework 2, I tried using the following route: 'default' => array( 'type' => 'Segment', 'options' => array( 'route' => '/:...