Pragmatism in the real world

Luke – Lucene Index Toolbox

If you want to understand what's in your Zend_Search_Lucene index files, then download Luke (http://www.getopt.org/luke/) and point it at the directory containing your index files. This is screenshot of my test index: Wow! What a very useful tool!

View Helper Case Notes

This is how it works: views/helpers/MyHelper.php contains class Zend_View_Helper_MyHelper which has a function called myHelper() Also, if you add a function called setView() to your class, then the View will pass you an instance of itself before it calls your view helper function. i.e. Class Zend_View_Helper_MyHelper { protected $_view; public function setView($view) { $this->_view = $view; } public function myHelper($myVar) { return $this->_view->escape($myVar); } }

Downtime

Just a heads-up. Tomorrow, this site is being moved to a new server and so is going to be down for most of tomorrow from around 10:00 (GMT) to late evening.

Zend_Filter_Input / Zend_Validate Messages

The basic usage of Zend_Filter_Input is: $filters = array('body' => array('StringTrim' , 'StripTags')); $validators = array('body' => 'Alpha'); $input = new Zend_Filter_Input($filters, $validators, $_POST); if ($input->isValid()) { // do something with form } else { // failed validation $messages = $input->getMessages(); // iterate though $messages to display to user } The problem is that the message you get out isn't always written as you would like. Consider the output if the body record is empty.… continue reading.

Zend Framework Book coming soon

Now that it's been announced by Manning, I think I can talk a little more about the project that's been taking up most of my spare time! Zend Framework in Action is a collaboration between myself and Nick Lo. We are still writing, but Chapter 1 is available for you to download and see where we are heading with the book. Manning has an early access program where you can get access to pre-production PDFs… continue reading.

Image Resizing Done Right

This is getting a lot of blog-sphere time at the moment. What an excellent idea! (Via The Guardian, who found it on TechCrunch)

ID != id

I've finally updated the source code to my Zend Framework tutorial so that the hidden field in the form is named "id" rather than "ID". A minor error that meant that editing didn't work! This is because in PHP $_POST['id'] is not the same as $_POST['ID']! Whilst I was poking around the source code, I also changed the Zend Auth tutorial to use $db rather than $dbAdapter so that it is consistent with the first… continue reading.

PHPWM Social

I've just come back from the PHPWM social for this month. We meet monthly and alternate between social and technical meets. This month, we met at the Hopwood House pub in Alvechurch, south of Birmingham. We talked geek for a few hours and I highly recommend joining your local PHP user group as it's a great way to meet people who don't look askance at you when you mention MVC!

Zend Framework Tutorial Zip File Updated

I've finally got around to updating the Zip file on the tutorial page! This time, I've created two files: one with the Zend Framework (1.0.1) included and one without. The one without is much smaller at only 9KB, where as with the Framework, the zip is 2.2MB. The links are: Zip file of tutorial (~9KB) Zip file of tutorial including ZF1.0.1 (~2.2MB) I've also updated the tutorial itself to 1.4.4. This is a really minor… continue reading.

YSlow!

I've been playing recently with YSlow! from Yahoo! and it's quite cool. It's a plug-in for Firefox that works in combination with Firebug that gives you pointers as to why your site isn't as fast as it could be. I noticed that one site that I'm developing at the moment was rated C, so thought I'd see what I could do easily to improve it. These are the items that I sorted out. Configure ETags… continue reading.