我开始学习ZendFramework。按照推荐配置。当调用使用默认代码创建的项目时,它可以完美地工作。当我注释所有index.php并添加代码时:
index . php
<?php
include 'Zend.php';
Zend_Loader::loadClass('Zend_Controller_Front');
Zend_Controller_Front::run('controllers');
?>
<html>
<head>
<title>Chomp! The online feedreader</title>
</head>
<body>
<table>
<tr><td colspan="2">
<h1>CHOMP!</h1>
<h3>the only feedreader you'll ever need</h3>
</td></tr>
<tr><td style="width: 200px;">Login info here</td><td>Content here</td></tr>
</table>
</body>
</html>
indexController.php
<?php
class IndexController extends Zend_Controller_Action
{
public function init()
{
/* Initialize action controller here */
}
public function indexAction()
{
// action body
}
//Add por Debora
public function loginAction()
{
echo "This is the loginAction().";
}
public function registerAction()
{
echo "This is the registerAction().";
}
}
显示以下错误:
致命错误:类'Zend_Loader'没有找到C:'wamp'www'ProjetoZend'public'index.php on line 5
有人能帮我吗?
谢谢!
您必须包含实际的加载器文件,而不是一些可能甚至不存在的文件。
// this will not help you access your Zend_Loader class
include 'Zend.php';
// something like this
include '/path/to/library/Zend/Loader.php'
附加注意:您的设置可能无法工作,直到您在set_include_path()