【发布时间】:2013-01-30 22:28:15
【问题描述】:
我在 my.phpcloud.com 上运行 Zend Framework 应用程序(所以服务器配置应该没问题...)
索引页面工作正常,我修改了 application/controllers/IndexController.php 如下:
class IndexController extends Zend_Controller_Action
{
public function indexAction()
{
$this->view->assign('hello', 'hello world!');
}
}
在 application/views/scripts/index/index.phtml 我打印 $this->hello 并且一切正常。
但是如果我创建一个新的控制器,比如 application/controllers/UserController.php
class UserController extends Zend_Controller_Action
{
public function indexAction()
{
$this->view->assign('name', 'Albert');
}
}
我在 application/views/scripts/user/index.phtml 中创建了视图,并像在索引视图中一样打印 $this->name。
但是当我访问 http://myapp/user 时,我得到了一个 Not Found 错误...有什么问题?
【问题讨论】:
-
检查您的重写规则 (.htaccess) framework.zend.com/manual/1.12/en/…
-
我的bootstrap.php是空的,我应该在里面写什么?
-
它为空时没问题;)只有当你必须自己引导东西时才需要
标签: php zend-framework