zend-framework2

ZF2 + Doctrine2 - Fieldset in Fieldset of a Collection in Fieldset does not validate properly

有些话、适合烂在心里 提交于 2020-01-15 07:31:42
问题 I asked a similar question a while ago, which came down to the structuring of the Forms, Fieldsets and InputFilters. I've been thoroughly applying the principle of separation of concerns to split up Fieldsets from InputFilters as the modules they're created in will also be used in an API (Apigility based), so I would need only Entities and InputFilters. However, I now have a problem that when I have a Fieldset, used by a Fieldset, used in a Collection in a Fieldset, that the inner-most

ZF2: How do I implement a custom filter?

老子叫甜甜 提交于 2020-01-14 09:38:07
问题 I've been working with Zend Framework 2 for a few weeks now, and, even though the documentation online is pretty incomplete, I managed to build up a first draft of my website. Unfortunately, I got stuck while trying to implement a custom version of the Zend\Filter\File\Rename filter; here I sum up what I've done: 1) In my module called 'Library', created the file src\Library\Filter\File\Rename.php namespace Library\Filter\File; use Traversable; use Zend\Filter; use Zend\Filter\Exception; use

ZF2 how to listen to the dispatch event of a specific controller

我怕爱的太早我们不能终老 提交于 2020-01-14 08:17:11
问题 How can I listen to the dispatch event of a specific controller? At the moment I do the following: Module.php public function onBootstrap(EventInterface $event) { $application = $event->getApplication(); $eventManager = $application->getEventManager(); $serviceManager = $application->getServiceManager(); $eventManager->attach($serviceManager->get('MyListener')); } MyListener.php class MyListener extends AbstractListenerAggregate { public function attach(EventManagerInterface $eventManager) {

ZF2 Zend\Db Insert/Update Using Mysql Expression (Zend\Db\Sql\Expression?)

◇◆丶佛笑我妖孽 提交于 2020-01-14 07:48:10
问题 Is there any way to include MySQL expressions like NOW() in the current build of ZF2 (2.0.0beta4) through Zend\Db and/or TableGateway insert()/update() statements? Here is a related post on the mailing list, though it hasn't been answered: http://zend-framework-community.634137.n4.nabble.com/Zend-Db-Expr-and-Transactions-in-ZF2-Db-td4472944.html It appears that ZF1 used something like: $data = array( 'update_time' => new \Zend\Db\Expr("NOW()") ); And after looking through Zend\Db\Sql

config_cache_enabled Errors

怎甘沉沦 提交于 2020-01-13 18:22:48
问题 Using Zend Framework 2.1 When I set 'config_cache_enabled' => true inside of my application.config.php It's returning the following error: Warning: var_export does not handle circular references in /usr/local/apache/vhosts/otwebsoft_admin/vendor/Zend/ModuleManager/Listener/AbstractListener.php on line 67 After a few refreshes of the page then I get this: Fatal error: Call to undefined method Zend\Cache\Storage\Adapter\Apc::__set_state() in /usr/local/apache/vhosts/otwebsoft_admin/data/cache

Connect to Multiple data bases using Zend Framework 2 and DoctrineORMModule

喜你入骨 提交于 2020-01-13 13:43:50
问题 Hello i'm using Zend Framework 2 and DoctrineORMModule. I need to access to different data bases connections and map two different set of schemas. 'doctrine' => array( 'connection' => array( 'orm_default' => array( 'driverClass' => 'Doctrine\DBAL\Driver\PDODblib\Driver', 'params' => array( 'host' => 'HOST', 'port' => '1433', 'user' => 'USER', 'password' => 'PASS', 'dbname' => 'DBNAME', ) ) ) ), ///////////// 'doctrine' => array( 'connection' => array( 'orm_default' => array( 'driverClass' =>

Limit the results in Apigility

元气小坏坏 提交于 2020-01-13 09:56:12
问题 I created a code connected API with Apigility. For now I am using the standard create stubs. In my PostResource there is a method called fetchAll($params = array()) . I created the code for the method so that it returns a paginatable set of results: /** @var HydratorInterface $hydrator */ $hydrator = new \Zend\Stdlib\Hydrator\ClassMethods(); /** @var PostService $postService */ $postService = new PostService(); $posts = $postService->findAll(/* Limit, default 10 */); $apiData = array();

ZF2 route parameters with slash

被刻印的时光 ゝ 提交于 2020-01-13 04:23:28
问题 Is it possible to assemble a route with parameters containing forward slashes? Config: 'someroute' => array( 'type' => 'Zend\Mvc\Router\Http\Segment', 'options' => array( 'route' => 'someroute/:path', 'defaults' => array( 'controller' => 'Controller', 'action' => 'index' ), 'constraints' => array( 'path' => '(.)+' ) ) ) Controller: $path = 'some/subdirectory'; $this->url('someroute', array('path' => $path)); Results in: http://host.name/someroute/some%2Fsubdirectory 回答1: Using rawurldecode()

Pagination using Doctrine and ZF2

亡梦爱人 提交于 2020-01-11 19:42:30
问题 i am trying to implement Pagination Using ZF2 and Doctrine. What i am trying to do here is to fetch data from An associated table lets say 'xyz'. Where as my categories table is doing one to many self referencing on its own PK. MY catgories tables has following feilds ID (PK) Created_at Category_id (self referencing PK) My XYZ table lets say it is called Name table has ID (PK) Category_id(FK) name Detail This is what i am trying to do to fetch data public function allSubcategories($id,

Pagination using Doctrine and ZF2

旧街凉风 提交于 2020-01-11 19:40:03
问题 i am trying to implement Pagination Using ZF2 and Doctrine. What i am trying to do here is to fetch data from An associated table lets say 'xyz'. Where as my categories table is doing one to many self referencing on its own PK. MY catgories tables has following feilds ID (PK) Created_at Category_id (self referencing PK) My XYZ table lets say it is called Name table has ID (PK) Category_id(FK) name Detail This is what i am trying to do to fetch data public function allSubcategories($id,