《Programming PHP》第二版上市
2008-7-20 11:20 lasvegas
ZF的小问题

刚开始接触ZF,遇到几个小问题,不知道如何是好?

目录结构如下:

http://localhost

application---+---controllers +--indexController.php
                                            +--userController.php
                    +---views-scripts-index+--index.phtml
                                                        +--test.phtml
                                               +user----index.phtml

                 +---models
html-----------index.php
library-----Zend framework 目录


调用http://localhost/html 可以

不能调用
http://localhost/html/index
http://localhost/html/index/test
那里的问题?是apache,php配置的问题,还是ZF问题
http://localhost/html/index.php/user可以调用


index.php
<php>
<?php
// 路径设置
ini_set('include_path',ini_get('include_path').PATH_SEPARATOR.'../library');

require_once "Zend/Loader.php";
Zend_Loader::loadClass('Zend_Controller_Front');
......
</php>

indexController.php
[php]
<?php
require_once 'Zend/Controller/Action.php';
class IndexController extends Zend_Controller_Action
{
    public function indexAction()
    {
    //todo
     }
     public function testAction()
    {
    }
}
?>
</php>

2008-7-21 08:38 lasvegas
终于解决了

是rewrite 问题,希望大家别像我一样浪费时间, 解决方法是配置 apache 的httpd.conf
把   AllowOverride None 改为   AllowOverride All.

ZF 比CI麻烦点,呵呵

2008-9-13 20:26 DLDwintry
我的问题和你一样
可是我的apache 设置的是 AllowOverride All啊
点解???

2008-9-13 20:58 DLDwintry
晕,原来AllowOverride  有2个地方
我只改了一个

页: [1]
查看完整版本: ZF的小问题


Powered by Discuz! Archiver 5.5.0  © 2001-2006 Comsenz Inc.