zend-framework2

Could not open input file: zf.php [duplicate]

南楼画角 提交于 2019-12-12 02:34:27
问题 This question already has answers here : How to install Zend Framework 2 Tool with composer (2 answers) Closed 5 years ago . I am new in zend, so i installed zfTool from here I use the composer for installing the tool, the command is : composer require zendframework/zftool:dev-master But when i run the command : php zf.php version For example i got this error : Could not open input file: zf.php so please if someone has any idea i will be very appreciative. 回答1: If you downloaded using

Image error in DOMPDF for ZF2

a 夏天 提交于 2019-12-12 02:29:08
问题 Hello everyone and welcome, sorry about my english not my main language. I'm a beginner on Zend Framework 2 also. I got an issue with DOMPDF in ZF2, when i try to show an image in my web page (virtualhost with apache2, the folder in desktop). For example: <img src="/home/luifer/logo_uca.png" alt="logo_uca" /> With the error: [Sun May 18 12:28:45.023452 2014] [:error] [pid 7195] [client 127.0.0.1:57089] PHP Fatal error: Uncaught exception 'DOMPDF_Exception' with message 'No block-level parent

Zend framework 2 loop through elements of element collection

夙愿已清 提交于 2019-12-12 02:20:13
问题 I created a collection of inputs with Zend\Form\Element\Collection, like $this->add([ 'type' => 'Zend\Form\Element\Collection', 'name' => 'some-name', 'options' => [ 'label' => 'some name', 'count' => 3, 'target_element' => [ 'type' => 'text', ], ], ]); This codes renders 3 inputs with label and fieldset if I use echo $this->formCollection($form->get('some-name')); (or the like of formCollection) in the view script. I want to wrap each input of the collection into divs. My idea is to iterate

ZF2 - Iterating over a HydratingResultSet

时光怂恿深爱的人放手 提交于 2019-12-12 02:06:30
问题 I'm using TableGateway's selectWith function to return a HydratingResultSet of entities. I need to iterate through each of the entities of the result set - not sure how I'm to do it, but using a foreach gives the error "This result is a forward only result set, calling rewind() after moving forward is not supported". What I was trying to do is basically: $res = $this->tableGateway->selectWith($query); foreach($res as $r) {...} What am I doing wrong? We're using Zend Framework 2.3. Thanks in

Install multiple version of PHPUnit via composer

懵懂的女人 提交于 2019-12-12 01:59:49
问题 I am working with ZendFramework 1.x & 2.x , unfortunately ZendFramework 1.x supports only PHPUnit 3.x & Zend Framework 2.x requires PHPUnit 4.x For this i want to install 2 versions of PHPUnit, here is the composer.json file i tried. { "repositories": [{ "type": "pear", "url": "http://pear.symfony-project.com" },{ "type": "pear", "url": "http://pear.phpunit.de" }], "require-dev": { "pear-pear.phpunit.de/PHPUnit": "3.4.*", "phpunit/phpunit": "*" } } I am getting following message. Skipped

ZF2: How to render view from other module

帅比萌擦擦* 提交于 2019-12-12 01:58:31
问题 I have a problem with rendering view from other module. For example: I'm on page news.phtml and I need to add 'Add comment' page. The view of adding comments is in other module 'Comments' in file add.phtml. I have no idea how to include this file on news page. I've tried something like this: echo $this->render('module/Comments/view/comments/index/add.phtml'); echo $this->render('../../Comments/view/comments/index/add.phtml'); but nothing works. How could I do that? 回答1: you need to use

How to configure Zend 2 on a hosting server?

冷暖自知 提交于 2019-12-12 01:55:13
问题 I created a virtual host: www.attila-naghi.ro in the xampp. I put my project there and it works perfectly. Now I want to put it online, on a hosting server. I observed that my css and js are not loaded and if I access the controllers, I get the 404. This is the URL. Can anyone help me? thx This is my module.config.php file: <?php /** * Zend Framework (http://framework.zend.com/) * * @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository * @copyright

How to load select option from database in zf2

时光毁灭记忆、已成空白 提交于 2019-12-12 01:44:49
问题 I Have been following zf2 guide for blog I have created everything Controller, Factory, Form, Mapper, Model, Service, view etc In my form I have a select element $this->add(array( 'type' => 'select', 'name' => 'roleId', 'attributes' => array( 'id' => 'roleId', 'options' => array( '1' => 'Admin', '2' => 'Manager', ), ), 'options' => array( 'label' => 'Role', ), )); Now in this form I want to load the option for the role from the database. I tried loading the option by creating a simple

How to Extend a Fieldset in ZF2 to work with Doctrine’s Class Table Inheritance mapping strategy

故事扮演 提交于 2019-12-12 01:44:41
问题 I’m developing a project using Doctrine’s Class Table Inheritance mapping strategy which involves joining a parent table with one of a number of child tables depending on the value in a discriminator column in the parent table. I’ve got a working prototype in which the unique conglomerate fieldsets each contain duplicate copies of all of the code for the common elements from the parent entity. In order to ensure consistency and avoid excess code I want to change the fieldsets so that I have a

ZF2 Use non-en default locale for default Validator messages

扶醉桌前 提交于 2019-12-12 01:41:38
问题 I'm fighting with ZF2 to force one specific validation messages translation for any incoming browser locale. So I just want ZF2 to always use it's own provided translations of error messages to russian, this file: \vendor\zendframework\zendframework\resources\languages\ru\Zend_Validate.php I've tried creating Translator and setting it as Default at onBootstrap : $translator = new \Zend\Mvc\I18n\Translator(); $translator->addTranslationFile( 'phpArray', 'vendor/zendframework/zendframework