Learning the Yii Framework-note1

本文介绍了如何使用Yii框架在同一服务器上部署多个网站,并详细解释了文件目录结构及使用yiic命令创建新站点的过程。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Tip: If you’re going to be using Yii for multiple sites on the same server, place the framework folder in a logical directory relative to every site. That way, when you update the framework, you’ll only need to replace the files in one place.

1. Then move yourself into the framework directory

2.
The next step is to tell the yiic application, found in the framework folder, to create a new site. The syntax is
yiic webapp path /to/directory
 The  yiic  file is an executable that runs using the computer’s command-line PHP and that really just invokes the  yiic.php  script. 
You may be able to call it using just yiic or using ./yiic (i.e., run the yiic command found in the current directory). Or you can more explicitly call either script using php yiic or php yiic.php. Or you may need to indicate the PHP executable to be used: C:\php\php.exe yiic. You should try the variations on this command, as applicable to your computer, just to make sure you can invoke yiic, prior to trying to create the Web application.


In terms of files on the server, within the application directory (htdocs, for me), you’ll find:

  • assets : The assets folder will be used by the Yii framework primarily for jQuery (the JavaScript framework) integration. 
  • css
  • images
  • index-test.php
  • index.php
  • protected:The protected folder is actually the most important one: you’ll edit code found in that folder to change the look and behavior of the site. 
  • themes:allows you to create variations on the site’s template, just like themes in a WordPress blog.
The  css  and  images  folders are obvious. The entire site will also be run through one of the two index files (more on this in the next post). 



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值