文件系统的设置 - ZF Dream

文件系统的设置

阿克 posted @ 2008年10月20日 04:36 in 自学笔记 with tags 文件系统 , 1413 阅读

 一般来说,Zend Framework推荐这样的文件放置方法:

application/
    controllers/
        IndexController.php
    models/
    views/
        scripts/
            index/
                index.phtml
        helpers/
        filters/
html/
    .htaccess
    index.php

其中application下的是ZF的项目,包含了MVC三个部分的文件夹。html文件夹下是网站的默认访问跟目录,除了index.php和目录权限控制的.htaccess外,还可以放一些图片、CSS等不涉及程序的东西。

对于大的项目来说,上面这个单控制器的文件结构实际上还是不够的,如果使用Zend Studio for Eclipse的话,你会发现,创建一个ZF项目后,其默认的application下可以包含多个项目组:

application/
    default/
        controllers/
            IndexController.php
            ErrorController.php
        models/
        views/
            scripts/
                index/
                    index.phtml
                error/
                    error.phtml

            helpers/
            filters/
html/
    .htaccess
    index.php

你可以在application下设置与default平行的目录来作为另外一个模块(Module),这样项目的层次就更加分明。

(阿克原创,版权所有)


登录 *


loading captcha image...
(输入验证码)
or Ctrl+Enter
Host by is-Programmer.com | Power by Chito 1.3.3 beta | © 2007 LinuxGem | Design by Matthew "Agent Spork" McGee