致命错误:
在第 10 行对 D:\xampp\htdocs\demo\app\controllers\test_controller.php 中的非对象调用成员函数 charset()
PHP 控制器代码:
<?php
class TestsController extends AppController
{
var $name="Tests";
var $helpers = array('Html');
var $uses=array();
# demo action to check wheather html helper is working or not
function index()
{ echo "111111111";
echo $this->Html->charset();
echo "22222222222";
}
}
?>
我在点击 url 时收到上述错误:http://localhost/demo/tests
我正在使用 CakePHP 2.0 ALPHA(最新版本)。
请让我知道根本原因是什么。