zend-framework3

Dependency management in Zend Framework 2 MVC applications

房东的猫 提交于 2019-12-01 07:12:41
As the ServiceLocatorAwareInterface will likely be removed from the AbstractController in ZF3 , dependencies should instead be passed via the constructor or via setter methods. With this in mind, consider the use case of a user or site controller with actions such as register, activate account, login, logout, etc. At a minimum, this would require a UserService and 2 forms. Add a few more related actions (remote authentication, linking of accounts, etc.) and you end up with 4 or 5 forms. Passing all these dependencies via the constructor would be messy at best, and more importantly, only 1 form

Deprecated: Retrieve service locator in functional system - ZF2

假装没事ソ 提交于 2019-11-30 13:16:59
I'm developing a ZF2 system and it was working very well, but after I clone the repository in other computer this deprecated error has appeared: You are retrieving the service locator from within the class Module\Controller\Controller. Please be aware that ServiceLocatorAwareInterface is deprecated and will be removed in version 3.0, along with the ServiceLocatorAwareInitializer. You will need to update your class to accept all dependencies at creation, either via constructor arguments or setters, and use a factory to perform the injections. in /home/path/project/vendor/zendframework/zend-mvc

Doctrine2 Update Caused AnnotationRegistry registerLoader Error in Zend Framework 3

落爺英雄遲暮 提交于 2019-11-30 11:46:41
I'm working on a CMS based on Zend Framework 3.0 to manage a DB I with Doctrine. What is my problem when managing packages with composer? Recently, I updated all the packages to newest versions and sent it to server, nothing was changed in other files. After the update my site displayed the following error: Fatal error: Uncaught TypeError: Return value of Doctrine\Common\Annotations\AnnotationRegistry::registerLoader() must be an instance of Doctrine\Common\Annotations\void, none returned in /home/platne/serwer18346/vendor/doctrine/annotations/lib/Doctrine/Common/Annotations/AnnotationRegistry

understanding grid layout in zend

↘锁芯ラ 提交于 2019-11-30 09:46:09
问题 I'm a bit confused with designing forms in zend. I understood that I have the fields in my form class and the look should be done in the views. In the index view which is nearly plain html I don't have problems, but in the add and edit views which show my form I have problems to change the look. I have a viewscript like follows: <?php $title = 'AVB ändern'; $this->headTitle($title); ?> <h1><?= $this->escapeHtml($title) ?></h1> <?php $id= $form->get('id'); $id->setAttribute('class', 'form

ZF3 Dependency injection in Module.php

孤人 提交于 2019-11-28 10:55:20
问题 I'm currently migrating a ZF2 application to ZF3. Mostly everything is going smoothly but I'm stuck on one thing. In my Module.php, I have an ACL management using zend-permissions-acl. class Module { protected $defaultLang = 'fr'; public function onBootstrap(MvcEvent $e) { $eventManager = $e->getApplication()->getEventManager(); $moduleRouteListener = new ModuleRouteListener(); $moduleRouteListener->attach($eventManager); if (!$e->getRequest() instanceof ConsoleRequest){ $eventManager->attach

How can you add query parameters in the ZF2 / ZF3 url view helper

笑着哭i 提交于 2019-11-27 08:37:42
I'm attempting to create a url with a query string using a route, like so: $this->url('users') -> /users $this->url('users', ['sort' => 'desc']) -> /users?sort=desc However this doesn't seem to work (the second helper actually outputs /users ). According to this unofficial, out-of-date documentation there was once a way to do this by appending /query to the route name, however this gives a route-not-found exception. Can this be done using the current url helper? You can create a child route for your users route like this: 'users' => array( 'type' => 'Literal', 'options' => array( 'route' => '

How can you add query parameters in the ZF2 / ZF3 url view helper

风格不统一 提交于 2019-11-26 14:13:40
问题 I'm attempting to create a url with a query string using a route, like so: $this->url('users') -> /users $this->url('users', ['sort' => 'desc']) -> /users?sort=desc However this doesn't seem to work (the second helper actually outputs /users ). According to this unofficial, out-of-date documentation there was once a way to do this by appending /query to the route name, however this gives a route-not-found exception. Can this be done using the current url helper? 回答1: You can create a child