Phil Brown's Web Development Blog

Entries Tagged ‘PHP’

Zend Framework and Doctrine Part 1

I’ve begun to investigate the Doctrine ORM library and how to integrate it into Zend Framework applications. I figure this post and any subsequent ones on the topic can grow into some sort of discovery series. So, my first post is going to be a simple one – bootstrapping with Doctrine 1.2. I figured the […]

Overriding Zend form element default decorators, for good!

I’m sure everybody who has used Zend_Form has, at one time or another, wished they could change the default form element decorators in one fell swoop, simply and efficiently. Up until now, I’ve been using one of two methods to override the default “definition list” style; set each element’s decorator scheme on instantiation or, use […]

PHP suExec and custom php.ini files

Lately, I’ve noticed more and more shared web hosts making the switch to running PHP under suExec. The benefits of this are: PHP scripts run as the owning user No more file system permission juggling Scripts are generally sandboxed to the owner’s home directory Unfortunately, this poses a problem for any custom PHP configuration changes […]

Editor themes for Eclipse PDT – Obsidian

My PHP IDE of choice is Eclipse with the PDT plugin. The thing is, I always feel a little snow blind after a day’s coding, staring at that white screen all day. So much so that I’ve undertaken the arduous task of tweaking my colour preferences to match the Obsidian theme found in the more […]

Extending Zend Framework Application Resource Plugins

With the arrival of Zend Framework version 1.8 came the application resource plugins. These nifty little classes help bootstrap your application’s resources (views, layouts, database connections, etc). The default behaviour is suitable for most needs however, occasionally, you’re going to want to perform some extra functionality. Take for example the following use case – the […]

Changing layouts with Zend ContextSwitch

Ever since discovering Zend Framework’s ContextSwitch and AjaxContext action helpers, I’ve been hooked. What’s not to love about writing one controller action and having the request dictate the response format. Whilst this generally does the job for XML, JSON and AJAX HTML snippets where any layout is disabled, sometimes you just need to wrap that […]

Zend Framework Forms and magic_quotes_gpc

Introducing the bane of my existence – PHP’s magic_quotes_gpc. I won’t bore you with the details suffice to say that this is one of PHP’s greatest failings and I cannot wait until the world adopts PHP6 and this awful blight is removed forever. Until then, we’ll just have to deal with it. Now, there are […]

Zend Framework: Automatically fetch the grand total from a limit query

September 11, 2008 – Updated for Zend Framework 1.6 So you’ve got a nice limited result set for use in a paginated display. The thing with most pagination widgets is they need to know the grand total for determining the total number of pages. What you would normally have to do is manually issue a […]