Questions tagged [zf3]

Zend Framework 3 is a 5.6+ MVC framework and component library.

Zend Framework 3 is an initiative encompassing a number of strategies and projects. Official release statement

Release Date : 28June2016

The main component of Zend Framework 3 remains the MVC components, which now is composed of many separeted components. This allows more code reuse and independent development cycles among the various components. Also many performance improvements were made with respect to the previous version of the framework.

The main news of the framework appearing in this version is Expressive, a microframework for building PSR-7 middleware applications based on the new PSR-7 specification, which abstracts HTTP messages.

59 questions
2
votes
2 answers

ZF3 multiple database adapters

in ZF2 it was possible to configurate multiple adapters like this in the module.config.php: 'db' => array( 'adapters'=>array( 'db1' => array( 'driver' => 'Pdo', 'dsn' => 'mysql:dbname=zf2;host=localhost', …
rogaa
  • 370
  • 2
  • 16
2
votes
2 answers

ZF3 zend-mvc generic route for many controllers in one module not working

I'm in ZF3, using the zend-mvc-skeleton and trying to configure a generic route that will match as many URLs as possible as I want to be able to create new controllers (including action methods of course), and have them immediately available. The…
l_r
  • 1,060
  • 12
  • 23
1
vote
1 answer

Customer service and service factory not registering in ZF3

For some reason, I don't think that my 'service_manager' config is being read properly. This is mostly pretty much a brand-new skeleton checkout. Maybe a days work. I did another one recently and tried comparing. I can't figure out where I went…
Bluebaron
  • 2,289
  • 2
  • 27
  • 37
1
vote
1 answer

zend framework 3 and doctrine authentication

Started working on zf3 project with Doctrine but ran into this problem. This is my Factory public function __invoke(ContainerInterface $container, $requestedName, Array $options = null) { $authenticationService =…
Waqar Haider
  • 929
  • 10
  • 33
1
vote
1 answer

doctrine silently fails to delete entities on M side of 1:M

I am beginning to suspect that this doesn't work because in my use case it just doesn't -- as opposed to me missing something -- but I have to consult your expertise to make sure, and to see if anyone can suggesta workaround. I have a Many-to-Many…
David
  • 815
  • 8
  • 18
1
vote
1 answer

Zend Framework attach custom event to shared event manager

Using Zend Framework, I want to attach an event on my Application/Module so that on every dispach event this function will be called, for every module. This is my code: class Module { public function getConfig() { return include DIR…
Mendes
  • 17,489
  • 35
  • 150
  • 263
1
vote
1 answer

How to change layout for the error pages configured in modules.config?

I´m using ZF3 and I need to change the layout of my error pages. They are called by the following configuration in Application modules.config file: 'view_manager' => [ 'display_not_found_reason' => true, 'display_exceptions' …
Mendes
  • 17,489
  • 35
  • 150
  • 263
1
vote
2 answers

How to get access to a session container using ZF3?

Iḿ using ZF3 and I'm building a service that will provide application wide segmented access to the application session container. This service is called SessionContainerManager and will have methods to retrieve and update user identity, user ACLs,…
Mendes
  • 17,489
  • 35
  • 150
  • 263
1
vote
1 answer

How to inject a dependency into a Validator in Zend Framework 3?

I have created a custom Validator, called CredentialsValidator, that returns true, if passed credentials are valid. The actual validation of credentials is the responsibility of the dependency AccountService, which is available in the Validator via…
Jonathan Maron
  • 633
  • 1
  • 5
  • 11
1
vote
1 answer

Mock object in PHPUnit is not invoked

I have this code in my PHPUnit test and it's trying to mock a table entity. But when i try to run it i get this error. Expectation failed for method name is equal to when invoked 1 time(s). Method was expected to be called 1 times, actually…
madeye
  • 1,398
  • 3
  • 15
  • 33
1
vote
1 answer

zf3 Custom database factory doesn't want to apply

I have strange behavior with database custom factory. For example I want to use BjyProfiler and create 1 config like this: 'db' => array( 'driver' => 'Pdo', 'dsn' => 'mysql:dbname=framework;host=localhost', 'username' => 'root', …
Botman
  • 81
  • 7
1
vote
1 answer

Controllers must implement InjectApplicationEventInterface

I have a code that executes before page is rendered in Module.php like this. $eventManager->attach(MvcEvent::EVENT_RENDER, function(MvcEvent $event) { /** @var ServiceManager $sm */ $sm =…
madeye
  • 1,398
  • 3
  • 15
  • 33
1
vote
2 answers

ZF3 - Call a function with parameters in factories' Module class

I'm new in ZendFramework3 and I just want to know if it's possible to call a function with more arguments than just the serviceManager in factories (within my Module class) : (Is it possible to pass an argument next to the $sm argument?) //class…
1
vote
0 answers

what's the recommended practice for using doctrine/data-fixtures with Zend Framework 3?

Just thought I'd take the liberty of asking before I start banging my head on the desk. I'm aware of https://github.com/doctrine/data-fixtures, and in a ZF2 project I have used it following the pattern found at…
David
  • 815
  • 8
  • 18
1
vote
1 answer

What is the best way to refactor ZF2 ServiceLocatorAwareInterface to work with ZF3 in view helper?

I have view helper from ZF2 that doesn't work anymore with ZF3 because of ServiceLocatorAwareInterface deprecation. What's the proper way to refactor that class:
Botman
  • 81
  • 7