Browsing articles in "Frameworks and API's"
Nov
9

Working with Google Charts and Visualization API

Red line chart with pale gray backgroundThis week I had the chance to play around with Google’s charts API, and let me tell you that I’m loving it. In the past couple of years I’ve had to integrate charts into the different projects. I have used everything from Fusion Charts, to PHP/SWF Charts, and DOJO’s charting engine. But, since I learned that Google provided developers with an API to create charts on the fly, I wanted to give it a try. read more

Aug
21

Zend Framework and Firebug – Log and Debug your Projects

firebugWhen developing an application there are some important factors that you have to pay close attention to avoid problems in the future. I think one of the most important is logging information on how your application is working and when it fails.

Must of us like to log only big exceptions and fatal errors, but the truth is, that when you are in the development process it’s very important to keep track of not just errors, but important information of when something gets executed. As a web developer one of the most important tools to have is FireBug. If you didn’t know, FireBug has an API that you can use to send console messages for logging purposes, when debugging JavaScript. But, did you know you can use FireBug to debug your php applications? read more

Apr
22

Zend Cache and Zend Feed Problem

Today I ran into a problem while caching feeds using Zend_Cache. I decided that I wanted to cache the returned object by the Zend_Feed. I had something like this:

$rssFeedLink = 'http://www.smooka.com/blog/';
$cacheId = 'rss_feed';

$frontendOptions = array(
		   	'lifetime' => 1800, // cache lifetime of 30 mins
		   	'automatic_serialization' => true);

$backendOptions = array(
		    	// Directory where to put the cache files
		    	'cache_dir' => '/cache/'
			);

// getting a Zend_Cache_Core object
$cache = Zend_Cache::factory('Core','File', $frontendOptions, $backendOptions);

if (!$rss = $cache->load($cacheId)) {
	try {
		$rss = Zend_Feed::import($rssFeedLink);
	} catch (Exception $e) {
		$feedError = true;
	}

	//check to see if it did not fail
	if (!$feedError && is_object($rss))
	{
		$cache->save($rss, $cacheId);
	}
}

//assuming that everything went right while fetching the feed
foreach ($rss as $item) {
	$channel['items'][] = array(
		'title'       => $item->title(),
		'link'        => $item->link(),
		'description' => $item->description()
	);
}

read more

Apr
17

5 Things: Working with Zend Framework and Ajax

Today I wanted to write about 5 awesome Zend Framework components/helpers that can help you when working with ajax.

isXmlHttpRequest()

This handy little method can eliminate the need to send extra parameters such as /ajax/true/ to let the controller know it’s an Ajax request. read more