绘制“ error” 视图时我遇到了这个错误
ApiController cannot find the requested view "error".
所有目录都是小字母。 我正在用 Linux 机器操作 Yii 。
Sample Code:
class ApiController extends Api
{
private $api;
private $placesapikey;
public function __construct()
{
parent::__construct("Api");
$uri = explode( = , Yii::app()->request->getQueryString());
$this->api = end($uri);
$this->placesapikey = "";
if ($this->api != Yii::app()->params[ apikey ] || $this->api == )
{
$error[ data ][ title ] = "Un-Authorized Access";
$error[ data ][ message ] = "You are not authorized to access or view this area";
$this->render( error , $error);
exit;
}
}