Learning the Yii Framework-note1

来源:互联网 发布:simsun.ttc linux 编辑:程序博客网 时间:2024/05/29 07:50
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). 



0 0
原创粉丝点击