Archive for the ‘Php’ Category

Build a Facebook application with Zend Framework

Facebook basics

You can integrate your application with facebook in two way: with an IFRAME (using XFBML) or with FBML.
(If you are already familiar with how a Facebook application work you can skip this step) ….. read full article  http://dbglory.wordpress.com/2011/05/15/build-a-facebook-application-with-zend-framework/

Utilize eZcomponents to ZendFramework project

Assuming that folder “library” is in your include php path.

Create folder EZ in your library folder, and extract all files from downloaded zip/tar.bz2  in to it.

in Your controller :

require_once “EZ/Base/src/base.php”;
$autoloader = Zend_Loader_Autoloader::getInstance();
$autoloader->pushAutoloader(array(‘ezcBase’, ‘autoload’), ‘ezc’);

Then test it :

$info = ezcSystemInfo::getInstance();
echo $info->cpuType, “\n”;
echo $info->cpuSpeed, “\n”;

Get view object in preDispatch Plugin

class Digitalus_Controller_Plugin_Contacts extends Zend_Controller_Plugin_Abstract
{
     public function preDispatch(Zend_Controller_Request_Abstract $request)
     {
     $view =  Zend_Controller_Action_HelperBroker::getStaticHelper(‘viewRenderer’)->view;
     $view->contact1 =  ’contact1′;
     $view->contact2 = ‘contact2′;
     }
}
Return top

Svetoslav Stefanov Stefanov

Web Developer Svetoslav Stefanov