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); } }

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.

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.

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.

Russian and Polish Zend Framework Tutorial

A couple of new translations of my Zend Framework tutorial have crossed my desk in the last week. Kubek Bartosz has very kindly created a new up to date Polish version of my Zend Framework tutorial. Alex Musayev has created a Russian translation too. I say this a lot, but I really am still amazed that people think that my little tutorial is worth the effort of translating. Thank you very much guys. I'm sure… continue reading.

Two-Step view in Zend Framework 1.0.0

Paulo Nei wrote an email to fw-general which is, I suspect a very common issue that people are going to run into: Hi, I wanna put header & footer in all view templates. But with ZF I don't got an easy way to do it … At the moment, the Zend Framework doesn't have an "officially blessed" solution, so there are multiple approaches being used: 1. Front Controller plug-in. http://www.nabble.com/Controller-and-View-Question-tf3462561.html 2. Zend_Layout proposal. http://framework.zend.com/wiki/display/ZFPROP/Zend_Layout 3.… continue reading.

Zend Framework 1.0 Released

No doubt everyone who reads this blog already knows that Zend Framework 1.0 has been released. My code contribution isn't very large, but I am nevertheless very happy that Zend_Config "just works" for loading and reading configuration data. The MVC system within Zend Framework has come on by leaps and bounds since the first public release and is now flexible, robust and easy to use. One part of the MVC jigsaw that is missing is… continue reading.

Spanish versions too!

I am a little late in announcing this as my email inbox is overflowing and I missed the mail :( Claudio Cossio has translated both my Zend Framework tutorial and my Zend Auth Tutorial into Spanish! Thanks very much Claudio.

Zend_Auth tutorial in French

Just a quick heads up to let you know that the team at developpez.com have created a French version of my Zend_Auth tutorial. The French version of my tutorial, Débutez avec le Zend Framework, has also been updated in line with the 1.4.0. version. Thanks guys!