解析错误:语法错误,意外的“<”,预期为T_STRING或T_VARIABLE
问题描述:
我正在按照 net.tutsplus.com/tutorials/ 中给出的教程在PHP中创建Helloworld。以下是产生错误的控制器代码:
I am creating Helloworld in PHP by following the tutorials given in net.tutsplus.com/tutorials/. Following is the controller code which is creating the error:
<?php
class Helloworld extends Controller{
function index()
{
$this->load->model('helloworld_model');
$data['result'] = $this->helloworld_model-><span class="sql">getData</span>();
$data['page_title'] = "CI Hello World App!";
$this->load->view('helloworld_view',$data);
}
} ?>
有帮助吗?
答
您访问的页面上出现渲染错误。不应显示HTML标记。这是固定的行:
There was a rendering error on the page you visited. An HTML tag was being displayed when it shouldn't have been. Here is the fixed line:
$data['result'] = $this->helloworld_model->getData();