【发布时间】:2010-11-11 10:32:49
【问题描述】:
我有以下控制器:
<?php defined('SYSPATH') or die('No direct script access.');
class Controller_Static extends Controller_DefaultTemplate {
public function action_index()
{
View::set_global('message', '<span class="highlight">This is a global message.</span>');
$data = array (
'siteTitle' => 'Kohana Test Site',
'siteSubtitle' => 'A site to learn Kohana',
'menu' => View::factory('blocks/menu'),
);
$view = View::factory('templates/layout', $data);
$this->request->response = $view->render();
}
}
但是 kohana 给了我错误:
ErrorException [致命错误]:类 未找到“Controller_DefaultTemplate”
虽然 Eclipse 可以找到该文件(通过 F3)并且我认为 Kohana 能够通过自动加载找到所有类?
如何让 Kohana 找到 Controller_DefaultTemplate 类以便我可以扩展 Controller_Static?
【问题讨论】: