zend-framework2

ZF2 TableGateway how to get Primary key

为君一笑 提交于 2019-12-13 18:39:33
问题 I'm trying to determine primary key of table using MetadataFetature. However, the data are within protected $sharedData without any access method. How to acceess them ? Do I have create new class just to add "getPrimary" method ? Within AbstractTableGateway child: $metadata = $this->getFeatureSet()->getFeatureByClassName('Zend\Db\TableGateway\Feature\MetadataFeature'); die(vardump($this->sharedData)); getting Invalid magic property access in Zend\Db\TableGateway\AbstractTableGateway::__get()

Zf2 view helper URL child route with same params

空扰寡人 提交于 2019-12-13 18:06:37
问题 I cannot create a proper url using the URL view-helper when parent and child route have common/same params. my url config: 'contact' => array( 'type' => 'Segment', 'options' => array( 'route' => '/contact[/:contact][/action/:action]', 'constraints' => array( 'contact' => '[0-9]+', 'action' => '[a-zA-Z_-]+', ), 'defaults' => array( 'controller' => 'CrmContact', 'action' => 'index', ), ), 'may_terminate' => true, 'child_routes' => array( 'task' => array( 'type' => 'Segment', 'options' => array(

Zend\Mvc\Router\Http\Method and child routes

泪湿孤枕 提交于 2019-12-13 17:21:19
问题 i have defined two routes, /shoppingcart/ and a child route /shoppingcart/add/ which should only be available for POST requests. 'routes' => array( 'shoppingcart' => array( 'type' => 'literal', 'options' => array( 'route' => '/shoppingcart/', 'defaults' => array( 'controller' => 'ShoppingcartController', 'action' => 'shoppingcart', ), ), 'may_terminate' => true, 'child_routes' => array ( 'add-product' => array( 'type' => 'method', 'options' => array( 'verb' => 'post', 'route' => 'add/',

zend framework validate data in model instead in the form

試著忘記壹切 提交于 2019-12-13 17:07:32
问题 Using Zend Framework 2. In my application, to edit the data in the database is possible compile an html form or send an http post request(my server is implemented as a web service). In this second case the form is not rendered. Problem: If I put the validations rules in the form when the server recive a post request sent not from the form but from a generic http post request (like an mobile app) the data is not validated/filtered becouse the validations are bind in the form. Is possible to

Lucene Search in zf2

故事扮演 提交于 2019-12-13 15:01:48
问题 Has the Lucene Search library been removed from the ZendFramework 2? because I can't find it here 回答1: UPDATE: It has it's own repo here: https://github.com/zendframework/ZendSearch I couldn't find it. I wonder if it is interoperable with the previous version of the library. I also noticed that it was present in 1.9, but I don't see 1.9 available for download. There was work being done in the 2.0 branch here: https://github.com/Maks3w/zf2/commit/9796a6ff1f4fe71048b4f083f7ec746f4442e7dd This

Executing multiple join with expressions on Zend Framework 2

你离开我真会死。 提交于 2019-12-13 12:05:43
问题 Actually I'm working on a project and I'm looking on how Zend Framework 2 handle complex queries (expecially on how to join n:m tables and how to use GROUP_CONCAT and other functions). Do you know the best practice to execute this query: SELECT o. * , x.group_one, x.group_two FROM table_one AS o LEFT JOIN ( SELECT r.fk1, GROUP_CONCAT( t.field_one ) AS group_one, GROUP_CONCAT( t.field_two ) AS group_two FROM table_three AS r INNER JOIN table_two AS t ON r.fk2 = t.id GROUP BY r.fk1 ) AS x ON o

How to create new controller in zend framework [closed]

不想你离开。 提交于 2019-12-13 09:57:18
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 5 years ago . i have developed a website in zend framework version 1. now i want to create my another project in zend framework version 2. In version 1 whenever we need to create new module, new controller we used to do it with command line. now when i do it in zf2, i got error 'zf is not defined as external or internal

ZF2 private repository for project

☆樱花仙子☆ 提交于 2019-12-13 07:39:08
问题 I started ZendSkeletonApplication via Composer. I will need for my project PRIVATE repository (Git). How to do it? Skeleton have now .git files so how I can work with my project for example on BitBucket? Regards 回答1: The best way to create a ZF2 skeleton project from scratch is to use ZFTool (http://framework.zend.com/manual/2.1/en/modules/zendtool.introduction.html). Install it to /usr/local/bin (with executable permissions) and then you can do this: $ zftool.phar create project project_name

hydrating multiple objects from fieldsets ZF2

白昼怎懂夜的黑 提交于 2019-12-13 07:36:46
问题 I have a problem with hydrating the objects in ZF2. I have a form for saving either the organization-related info or person-related info into the database. The user makes the choice: save either organization or person. Just 1 form for all html inputs. In ZF2, I created 2 fieldsets. In each fieldset class, I use setHydrator(new ClassMethods(false)) and setObject(new <objectForHydration>) . The 2 fieldsets are included into the form with the following code: $this->add([ 'type' => 'Parties\Form

Composer fails to update with zfc-user-doctrine-orm

两盒软妹~` 提交于 2019-12-13 07:34:58
问题 i have the following composer.json { "name": "zendframework/skeleton-application", "description": "Skeleton Application for ZF2", "license": "BSD-3-Clause", "keywords": [ "framework", "zf2" ], "homepage": "http://framework.zend.com/", "require": { "php": ">=5.3.3", "zendframework/zendframework": "2.2.*", "doctrine/doctrine-orm-module": "*", "bjyoungblood/bjy-authorize": "1.2.*", "zf-commons/zfc-user": "dev-master", "zendframework/zend-developer-tools": "*", "zendframework/zftool": "dev-master