Today I found some time to play around a bit with the Zend Framework. My first experiences are that it is very easy to use and very well documented unlike most other PHP Frameworks. Adding a photo page to my site was easy to do with only 6 lines of code using the Framework:
Note: Flickr is actively promoting censorship, so you should not use it anymore. Treat the following as an example of the Zend Framework.
<?php
require_once('../includes/config.php');
require_once('Zend/Service/Flickr.php');
$page = new org_nohn_SmartyRenderer();
$page->setTitle('Photos');
$flickr = new Zend_Service_Flickr($flickr_api_key);
$results = $flickr->userSearch($flickr_user_id);
foreach ($results as $result) {
$page->addSimpleTextBlock($result->title,
'<a href="'.$result->Large->clickUri.'"><img
src="'.$result->Medium->uri.'"
alt="'.$result->title.'"
width="'.$result->Medium->width.'"
height="'.$result->Medium->height.'"></a>');
}
$page->render();
?>
Of course, there's also stuff I don't like. To get it working, I had to patch some files, there are warnings with E_ALL and it is not a PEAR package and can't be installed and upgraded with the PEAR installer, which would have been very easy with the (not so new) PEAR channels.
Posted Mar 05, 2006
Tagged as: PHP, Software Development