How to create new controller in zend framework [closed]

不想你离开。 提交于 2019-12-13 09:57:18

问题


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 command.'. how do i create module,controller automatically in zf2. i do not know their directory structure in zf2 so would not like to copy paste tutorial controller.
How do i create module,controllers in zf2.


回答1:


I assume you are using Windows as development OS, so download zftool and put it on C:/. Open the console and cd to C:/ then you an try the follow

1) create a zf2 project

zftool.phar create project path/to/project

2) create a new Module

zftool.phar create module ModuleName path/to/my/applicationRoot

3) create a new controller

zftool.phar create controller ControllerName ModuleName path/to/my/applicationRoot

You can discover by yourself all th other functionality just running only zftool.phar on console.

Cheers



来源:https://stackoverflow.com/questions/23385960/how-to-create-new-controller-in-zend-framework

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!