Faceplug plugin

Hey Guys,

I am new to Yii and trying to use extensions for the first time. I want to add facebook like button to every unique post on my application. however, I am a little confused by the configuration given on http://www.yiiframework.com/extension/faceplugs/

In the usage section the author asks to create the widget… (below in quotes)

Where does this code go? In the view or the controller?

the same question here ?

  1. $og is just a property of the LikeButton widget, so you should pass this array as the widget’s parameter when rendering it.

  2. Any kind of the widget should always be rendered inside views.

E.g.:




<h1>This is a view</h1>


<?php $this->widget('ext.faceplugs.LikeButton', array(

	'app_id'=>'APPID', // not needed if set in Yii configuration file

	'url' => $this->createAbsoluteUrl('/'),

	'og' => array(

		'title' => 'The coolest site on the WWW',

		'type' => 'website',

		'site_name' => 'My Awesome Site',

		'image' => $this->createAbsoluteUrl('/images/logo.gif'),

	),

)); ?>


<p>Other X/HTML tags.</p>