我正在关注锂 facebook 连接教程
http://www.shift8creative.com/blog/facebook-connect-and-lithium
加载页面时出现以下错误
Notice: Undefined variable: html in /var/www/lithium/app/resources/tmp/cache/templates/template_views_signs_index.html_1175517_1299986110_1801.php on line 3`
和
Fatal error: Call to a member function script() on a non-object in /var/www/lithium/app/resources/tmp/cache/templates/template_views_signs_index.html_1175517_1299986110_1801.php on line 3
我的 Facebook.php 页面开始如下
namespace facebook;
namespace \Exception;
我认为的第 3 行
<?php $html->script('http://connect.facebook.net/en_US/all.js', array('inline' => false)); ?>
错误可能源于什么?
最佳答案
html
是 HTML helper并且不再是一个神奇的变量,但可以使用 $this->html
到达反而。
有关更多信息,请阅读有关 lithium helpers 的文档。
所以只需这样做:
<?= $this->html->script('//connect.facebook.net/en_US/all.js', /* … */) ?>
关于php - 锂 Facebook 连接错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5287320/