Yii 1.1: social

Insert twitter, googleplusone and facebook button

Insert twitter, googleplusone and facebook button, accepting horizontal and vertical alignment.

Extension's code is XHTML valid.


Tested with Yii 1.1.7


  • Download the latest release package
  • Unpack it in /protected/extensions/ folder


Insert next code in your page, where do you want to place buttons.

<?php $this->widget('application.extensions.social.social', array(
        'networks' => array(
            'data-via'=>'', //http://twitter.com/#!/YourPageAccount if exists else leave empty
            'href'=>'https://www.facebook.com/your_facebook_page',//asociate your page http://www.facebook.com/page 
            'action'=>'recommend',//recommend, like

Usual parameters to be adjusted:

- style: button's alignment (string: horizontal or vertical).
- networks: social network which you must have (twitter, googleplusone, facebook);
- data-via:Your Twitter Page Account if exists or leave empty (url: //http://twitter.com/#!/YourPageAccount)
- size: google button size (string:small, standard, **medium**, tall)
- annotation: google button mode to show annotation(string: **bubble**, inline, none)
- href: Your Facebook Page (url: http://www.facebook.com/facebook_page)
- action: action for facebook button (string: **recommend** or like)
- colorscheme: used color scheme for facebook button (string: **light** or dark)
- width: the width for facebook button container (pixels: **120px**)


Total 10 comments

#15692 report it
hrnair at 2013/12/08 11:48am

facebook will work only if your data-href url exists and is a real one, not a local one.

#15581 report it
ptv1p3r at 2013/11/25 07:57am
Cant get this extention to work

Hi, just tryied your extention, but i can only display google and twitter and only in vertical, can't get facebook to work, any ideas ?

#13558 report it
newscloud at 2013/06/05 08:19pm
Request for features

Great work on this.

Is it possible to have facebook recommend a regular url on the internet vs. a facebook.com/page?

Is it possible to pre-load text & url to twitter as opposed to their default scraped info?

#13557 report it
newscloud at 2013/06/05 08:18pm
Demo site: Using it on Geogram.co Place Pages

You may need to join to see the live demo: http://geogram.co/phinney-ridge

Screenshot here:


#7300 report it
Sampa at 2012/03/12 12:50pm

<?= works even with short tags off. I got suprised when I noticed, but its true:)

(I have short tags off on my localhost and use <?= all the time )

#6734 report it
alejofonseca at 2012/02/01 10:43pm
Where can I download the extension from?

Thanks very much!

#6526 report it
MichaelH at 2012/01/16 11:07am
Works great!

Very good extension works right out of the box.

I did made some changes ;-)

"<?=" has been replaced with "<?php echo" in the views. There is always that one host that doesn't support short tags. (mine)

In the init() function it looks like you are making calls to abstract functions "self::" instead of "$this->" have no idea why this is?

I made the widget extend from CWidget instead of CInputWidget

Added a public property $htmlOptions and changed last line social->renderSocial()


echo $this->render('social', array('rendered'=>$rendered));


echo CHtml::tag('div', $this->htmlOptions, $rendered);
#6428 report it
Sampa at 2012/01/09 08:13pm

absolutely awesome job done here.

#5686 report it
MetaYii at 2011/11/01 04:06pm
Good work.

Very easy to use. Just a minor problem: multiple G+ buttons on the same page are not displayed.

#5331 report it
Gustavo Lima at 2011/10/05 08:17am

Very Good!

Leave a comment

Please to leave your comment.

Create extension