我在蛋糕通知(8)中有一个错误:未定义的变量:html[APPViewLayoutsdefault.ctp,


i have an error in cake Notice (8): Undefined variable: html [APPViewLayoutsdefault.ctp, line 6]

注意(8):未定义变量:html[APP''View''Layouts''default.ctp,第6行]

致命错误:在D:''Xampp''htdocs''mvc''cakehp''app''View''Layouts''default.ctp的第6行对非对象调用成员函数css()

在defolt.ctp 中

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <title>Tasks</title>
    <?php echo $this->html->css(array('style.css')); ?>
</head>
<body>
        <?php echo $content_for_layout; ?>
</body>
</html>

在home.ctp中查看

<h1>Welcome!</h1>
<p>Welcome to my task management site.</p>

如何在CakePHP 2.5.5中删除此错误。

Change $html->css(...) to $this->Html->css(...)