如何使用 Yii 框架使用 yiic 命令创建 webapp [英] how to create webapp with yiic command using Yii Framework

查看:18
本文介绍了如何使用 Yii 框架使用 yiic 命令创建 webapp的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在 Yii 中构建我的第一个应用程序,其网站上的指南位于以下地址:http://www.yiiframework.com/doc/guide/1.1/he/quickstart.first-app # 添加评论问题是通过 YIIC 安装应用程序框架的任何问题都不会出现.我做了以下事情:1. 我浏览了作为我的 WAMP 服务器的框架的 CMD 库.2.我写了如下命令:yiic.php webapp www/blog,我也试过如下命令:yiic webapp www/blog.

I'm trying to build my first app in Yii, the guide on their website at the following address: http://www.yiiframework.com/doc/guide/1.1/he/quickstart.first-app # add-comment The problem is that any issue installing the application framework through the YIIC can not have that. I did the following: 1. I went through the CMD Library of the framework that is my WAMP server. 2. I wrote the following command: yiic.php webapp www/blog, I also tried the following command: yiic webapp www/blog.

据我了解他们的指南,是否应该有一个名为 blog 的目录,其中包含一个框架应用程序.实际发生的情况是windows打开了一个标题为打开方式"的窗口,要求我选择要打开yiic.php的程序来查看文件内容.

As I understand their guide, should there be a directory called blog with a skeleton application. What actually happens is that windows opens me the window titled "Open With" asking me to choose which program I want to open the yiic.php to view the contents of the file.

推荐答案

在 Windows 上,您只需转到框架文件夹并键入:

On windows you just go to your framework folder and type:

yiic webapp pathToYourNewProject

yiic 将默认为 yiic.bat,因此您无需指定任何 php.exe(我并不是说它不会那样工作).新项目的路径可以是相对的也可以是绝对的,以下是一些示例:

yiic will default to yiic.bat so you don't need to specify any php.exe (I'm not saying that it wouldn't work like that). and path to your new project can be relative or absolute, here are some examples:

-- C:
   |
   -- sandbox/
     |
     --yii/
     | |
     | --framework/
     |   |
     |   --yiic.bat (for Window)
     |   --yiic.php (for Linux)
     --newWebApp/

要在 Windows 上创建,我使用:

To create on Windows i use:

cd c:sandboxyiiframework
yiic webapp ../../newWebApp
type yes when prompted and you're done

cd c:sandboxyiiframework
yiic webapp c:sandbox
ewWebApp
type yes when prompted and you're done

在 Linux 上创建:

To create on Linux:

cd /media/sf_sandbox/yii/framework/
./yiic webapp ../../newWebApp

这篇关于如何使用 Yii 框架使用 yiic 命令创建 webapp的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆