Search code examples
phpfacebooklithium

Lithium Facebook Connect Error


I'm following the lithium facebook connect tutorial http://www.shift8creative.com/blog/facebook-connect-and-lithium

I get the following errors when i load my page

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`

and

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

My Facebook.php page starts as follows

namespace facebook;
namespace \Exception;

And line 3 of my view

<?php $html->script('http://connect.facebook.net/en_US/all.js', array('inline' => false)); ?>

What may the error stem out of?


Solution

  • html is the HTML helper and isn't a magical variable anymore but can be reached using $this->html instead.

    For more information, read the documentation about the lithium helpers

    So just do:

    <?= $this->html->script('//connect.facebook.net/en_US/all.js', /* … */) ?>