-1

how to add facebook like features in zend based application ? is the code will be placed in view or in helpers ?

facebook.app_id = "APPID"
facebook.app_secret = "SECRET"

thanks

d3bug3r
  • 2,492
  • 3
  • 34
  • 74

1 Answers1

0

the easiest way to add facebook like in zend is by adding the code in helpers, later can be called from the view.

class Application_View_Helper_GetFacebookLikeBox extends Zend_View_Helper_Abstract
{
public function getFacebookLikeBox()
{
    $config = Zend_Registry::get('config');
    $app_id = $config['facebook']['app_id'];

    return '<iframe
                src="//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2FEXAMPLE&amp;
                    width=250&amp;height=284&amp;colorscheme=light&amp;show_faces=true&amp;border_color&amp;
                    stream=false&amp;header=false&amp;appId='.$app_id.'"
                scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:250px; height:284px;"
                allowTransparency="true">
            </iframe>';
}
}

then from view just call $this->getFacebookLike(); will render the facebook like button.

d3bug3r
  • 2,492
  • 3
  • 34
  • 74