Author Archive for Andy

QrCode view helper

You see QrCodes popping up every now and again on sites, in publications and the like. I think they can be a very handy way for people with cameras on their phones to get a url or other content on to their phone very easily. (I’m thinking more about those people without iPhones or full keyboards, of course!)

If you’ve never seen a QrCode before, it looks something like this:

QR Code image

Now how cool would it be to be able to generate that automatically for each page on your site and allow people to be able bookmark that site on their phone? Well, I think it’d be pretty cool! So I came up with a very simple ZF view helper to do it for me.

Continue reading ‘QrCode view helper’

Today’s date

Today’s date has a lovely palindromic quality to it:

01022010

Cool. :)

Adding new items to RSS feed – it shouldn’t be this hard!

I have just started to use the Zend_Feed related components in earnest and am really liking the Zend_Feed_Writer (new to ZF 1.10.0). So what I wanted to do was created an RSS feed file is one didn’t exist and then keep updating that file as-and-when new items came in. Seems a really easy and simple thing to do, right? That, unfortunately, has not been my experience.

I have to say that to documentation seems quite lacking on the ZF site (for all the the Feed components, really, not just the Writer). Because of that, what follows may be idiotic and there really is an easy way. If so, I hope that you will post up a comment and let me know because I’d love to learn!

On with what I did…

Continue reading ‘Adding new items to RSS feed – it shouldn’t be this hard!’

Zend_Form decorators webinar

If you’re not sure about Zend_Form’s decorators, what they are or how to use them, then Matthew Weier O’Phinney has the webinar for you:

http://www.zend.com/webinar/Framework/webinar-leveraging-zend_form-decorators-20091216.flv

It’s a great introduction to decorators, how to implement them and how to do slightly more complex things with them. Well worth a watch!

Same height for elements – now with jQuery goodness!

A while ago I wrote a post on how to use the Prototype js library to make elements on your page have the same height.

For those too lazy to read that post, it can be summarised something like this:
Continue reading ‘Same height for elements – now with jQuery goodness!’

Pointless error message

Just ran a bit of SQL on Oracle and this was the oh-so helpful error message I got back:

Warning: ociexecute() [function.ociexecute]: OCIStmtExecute: ORA-00932: inconsistent datatypes: expected BINARY got BINARY

So you’re expecting a binary value and what you got was a binary value, but that’s inconsistent with the binary value you were expecting to be binary?!

PHP Team Development book review

Book coverSo I’ve finally finished the book!  OK, I finished it a couple weeks ago but haven’t had a chance to post up a review yet.  Of course, I had every intention of finishing it a lot earlier considering I was flying for nine hours to the States and then another few hours on to Mexico – and the journey back again! – but that really was just wishful considering I was travelling with my two year old son.  Oh well! :-)

On with the book review…

The book, as the title makes it plainly obvious, is about developing your team in relation to working with PHP.  It’s aimed at, well, pretty much anyone who has an interest in developing or working in a team, be it managers who need to set up and manage teams or developers working within a team who want to improve their work flow and procedures, or anyone in between.  It does this by giving an overview on several subjects, but doesn’t go as far as to tell you that you must do x, y or z.  This is understandable, though, as every team is different and the book acknowledges this.

Continue reading ‘PHP Team Development book review’

PHP Team Development (book)

Book coverThe other day I had a new book sent to me called PHP Team Development, written by Samisa Abeysinghe and published by Packt Publishing. Unfortunately, it arrived at work when I was on holiday so I haven’t been able to have a look at it yet. :-/ However, I’m back today and have the book in my hands (well, not literally, of course, else typing would be much more difficult), so am looking forward to diving in to it.

Hopefully have a bit of a review posted up here some time soon!

Zend Framework hidden gems

Sometimes you come across hidden little gems in the Zend Framework that save you time, even if that’s just down to the amount of text you need to type. The Zend_View holds one of these little gems…

Did you know that you can use the short php open tags and echo tag in your view scripts, and you don’t even need to have this turned on in the php.ini file?

So you can have things like:

<? $this->viewHelper(); ?>

and:

<?= $this->variable; ?>

instead of:

<?php $this->viewHelper(); ?>
<?php echo $this->variable; ?>

Might not seem a lot, but when you have a lot of view scripts to write then you can save quite a few key strokes.

It’s able to do this, even if you have short_tags off (as it should be!) because Zend_View uses a stream to open and seek through the view script – Zend_View_Stream.

Text box ‘hint’ values with jQuery

On creating a rather large form recently, I was in the need to have some kind of hint to the user about what format the content should take on several input boxes. I could have done this with a description under the form element, but a more accepted way to do this, it seems, is to have a ‘hint’ in the element itself. You know the kind of thing I mean; a value, usually quite a light grey colour, that is present until you click in to the form element and then is disappears. I also wanted to do this as a jQuery plug-in because, well, why not? :-)

Continue reading ‘Text box ‘hint’ values with jQuery’