How to shorten your $html->image() statements
To include an image in a page, you probably use a code snippet similar to the one shown below:
$html->image('logo.png', array('width' => 500, 'height' => 300));
If you don’t want to type that much there is a little trick: use a string as second parameter. With that trick the previous example can be shortened to:
$html->image('logo.png', 'width="500" height="300"');




Hey that’s great !
Pretty much simplier … thanks !
Thats great, im new to Baking with Cake and im find your site a great resource!
Thanks v.much :D
I also hate arrays :P
I am glad it is useful for you guys :)
I guess this can be done in any html helper tag, can’t it?
@KesheR: Yes, it should work for other htmlhelper functions, too.