zend-framework2

zftool not behaving as expected

怎甘沉沦 提交于 2019-12-11 02:19:57
问题 I have a hosting service in linux, where I’m trying to develop an app on zend framework 2. I want to use zftool but regardless which zftool command I run, I get always the HTML of the home page. I’ll really appreciate any help. Here are the steps to reproduce: 1 - I installed composer >curl -s https://getcomposer.org/installer | php 2 - I installed the Skeleton MVC application >php composer.phar create-project -sdev --repository-url="https://packages.zendframework.com" zendframework/skeleton

How to write a vendor programme/module for ZFT

夙愿已清 提交于 2019-12-11 02:06:44
问题 I would like to write a Zend Framework 2 vendor module, hosted on github, installable via composer and given to the world at large! Now while I have no problems writing modules, where I am struggling is the mechanics around this. My initial instinct would be to do something like this: Set up a zend framework 2 skeleton app Add my module as a normal module Navigate to the module folder and create a git repo Work on the module and update the module to my gitto... Now logic tells me this is not

creating zend project with netbeans, how to?

北战南征 提交于 2019-12-11 02:05:29
问题 i downloaded zend framework 2.0 and include the zf.bat file in the netbeans as well in the Environment Variables i place the zend framework into my xampp folder for convenience: C:\xampp\zf\bin\zf.bat When i try to register provider in netbeans i get : PHP Fatal error: Class 'Zend\Tool\Framework\Client\Console\Console' not found in C:\xampp\zf\bin\zf.php on line 611 Fatal error: Class 'Zend\Tool\Framework\Client\Console\Console' not found in C:\xampp\zf\bin\zf.php on line 611 any ideas on

Fatal error : class not found in Zend framework 2

故事扮演 提交于 2019-12-11 02:00:03
问题 I'am stuck in zend framework , i am new to it and trying to implement a website just to learn it . So my website is about pizzas . when I try to add a pizza , after sending form data , i get this error message saying : Fatal error: Class 'PizzaPoint\Controller\Pizza' not found in C:\wamp\www\pizzalast\module\PizzaPoint\src\PizzaPoint\Controller\PizzaController.php on line 27 , at this line exactly i instantiate an object of the class Pizza which is located in the " Model " folder . this the

Must I move data dependency out of my Controllers (and into Factories)?

こ雲淡風輕ζ 提交于 2019-12-11 01:56:06
问题 This question can be viewed through a prism of ZF2 + Doctrine + MVC programming practices, or it can be viewed through just an OOP perspective. My concern is about Separation of Concerns, and on removing dependencies. I am using code in my controllers that goes something like this: class MyController { private $em; //entityManager function __construct() { $this->em = DoctrineConnector::getEntityManager(); } function indexAction() { //Input $inputParameter = filter_input(...); //request for

ZF2 How to pass a variable to a form

一笑奈何 提交于 2019-12-11 01:43:53
问题 What's the easiest way to pass a variable to a form in zend framework 2? It seems you can only send a name value to the contructor, but i need to send a few options to the form to set/fill some selectors. Thanks! 回答1: If you extend Form with your own class: class MyForm extends \Zend\Form\Form You can then pass in any variables you like via it's constructor and pass the form name to the parent Form class as such: public function __construct($myVar, $myVar2) { //do things with my vars $this-

ZF2: How to get Zend\Navigation inside custom route?

廉价感情. 提交于 2019-12-11 01:41:32
问题 I have custom router and I have to get access to Zend\Navigation inside this custom router. I was googling, asking and searching and no results :/ All I need is to find nodes with 'link' param using Zend\Navigation in my Alias::match function. Here is my module.config.php: 'navigation' => array( 'default' => array( 'account' => array( 'label' => 'Account', 'route' => 'node', 'pages' => array( 'home' => array( 'label' => 'Dashboard', 'route' => 'node', 'params' => array( 'id' => '1', 'link' =>

How to perform an INSERT INTO SELECT query in ZF2

末鹿安然 提交于 2019-12-11 01:39:20
问题 What’s the best way to perform an INSERT INTO SELECT query in ZF2? I need to develop a function in ZF2 that selects a subset of records from one table and inserts those records into another table. If I were programming in SQL, the statement would look like this: INSERT INTO target (tgt_col1, tgt_col2) SELECT 'flag' as marker, src_col2 FROM source WHERE src_col1='mycriteria' I’ve searched the Doctrine docs and cannot find an INSERT method. I’ve posted a similar question under the Doctrine tag

ZF2 router configuration for subdomain with child routes

一笑奈何 提交于 2019-12-11 01:38:15
问题 I need my router configuration to work as follows: www.bmob.co.uk -> DtCompanyData\Controller\CompanyMap wage.bmob.co.uk -> DtWage\Controller\Wage wage.bmob.co.uk/brighton -> DtWage\Controller\WageBrighton After reading the documentation and many similar questions on here, I can get the routing to work either for the subdomain, or for the child routes, but not both at the same time. When I have // In Application/config/module.config.php: 'home' => array( 'type' => 'hostname', 'options' =>

Using HTTP routes within ZF2 console application

China☆狼群 提交于 2019-12-11 01:36:03
问题 I'm trying to write a console action to regenerate the XML sitemap for my application. ZF2 is detecting that I'm running the CLI version of PHP and is thus using console routing, but it then chokes with a "Route with name 'xxx' not found" when Zend Navigation tries to build the sitemap, because it doesn't know about any of the named HTTP routes. The same code works perfectly fine when used through the normal HTTP controller. Is there a way to make HTTP routes work within a console application