Zend Framework:如何在命令行中在 WINXP 中创建控制器 [英] Zend Framework: How to create controller in WINXP on command line
问题描述
我在 Windows XP 和 WAMP 服务器上使用 Zend 框架.
I am using zend framework with windows XP and WAMP server.
我使用以下 DOS 命令创建了 zend 项目:
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
我的项目创建于:
C:\wamp\www\test
现在我有两个问题.Q.1:我将在哪个文件夹中使用 DOS 运行我的 create controller zend 命令?
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>
问:2 我已尝试在上述两个文件夹位置运行创建控制器命令.我有以下错误.如何解决这个问题?
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
谢谢
推荐答案
使用 xampp 流程如下:
创建项目
工作目录:htdocs
zf.bat create project zftest
cd zftest
创建模块
工作目录:htdocs/zftest
zf.bat create module testmodule
创建控制器
工作目录:htdocs/zftest
zf.bat create controller testcontroller index-action testmodule
注意每个命令的工作目录
Xampp 是一个适用于多个不同平台的应用程序堆栈,它的用途主要是能够以快速有效的方式设置工作开发平台.
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.
indexaction 参数用于在创建的控制器中创建默认索引操作.
The indexaction parameter is there to create a default index action in the created controller.
这篇关于Zend Framework:如何在命令行中在 WINXP 中创建控制器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!