Zend Framework: How to create controller in WINXP on command line

痞子三分冷 提交于 2019-12-11 08:27:42

问题


I am using zend framework with windows XP and WAMP server.

I have created zend project using following DOS commands:

SET PATH=%PATH%;C:\wamp\bin\php\php5.3.0    
C:\>wamp\www> C:\wamp\www\ZendFramework\bin\zf.bat create project test

and my project is created at:

C:\wamp\www\test

Now I have two questions. Q.1: In which folder I will run my create controller zend command using DOS?

C:\wamp\www\test>
or
C:\wamp\www\test\application\controller>

Q:2 I have tried both above folder locations to run create controller command. I have following error. how to solve this?

COMMAND
C:\>wamp\www\test> C:\wamp\www\ZendFramework\bin\zf.bat create controller test

ERROR:
    Fatal Error: Cannot Redeclare class Zend_Loader in C:\wamp\www\test\library\Zend\Loader.php on line 31

Thanks


回答1:


See this related post. If you have copied the ZF framework to the C:\wammp\www\test\library folder then you will need to comment out this line in your test\application\configs\application.ini file so that the ZEND_LOADER class isn't included twice:

;includePaths.library = APPLICATION_PATH "/../library"




回答2:


Using xampp the procedure looks like this:

Create Project
working directory: htdocs

zf.bat create project zftest
cd zftest

Create module
working directory: htdocs/zftest

zf.bat create module testmodule

Create controller
working directory: htdocs/zftest

zf.bat create controller testcontroller index-action testmodule

Notice the working directory of each command

Xampp is an application stack for several different platforms, it's use is mainly to be able to setup a working development platform in a fast and effecient way.

The indexaction parameter is there to create a default index action in the created controller.



来源:https://stackoverflow.com/questions/1734166/zend-framework-how-to-create-controller-in-winxp-on-command-line

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