I've decided to try out the Zend Framework on my latest little project. Whilst it's not entirely up to scratch at the moment I figured it's probably one of the few frameworks out there with any sort of guarantee of longevity.
My problem comes about in one of my controllers. I've loaded a class (Option) using the Zend::loadFile() function within one of my actions. I then create a series of Option objects with the intention of passing them to another function for processing.
Creating them is no problem at all - I simply call the Option constructor and pass in the correct parameters. The trouble is that the created object does not appear to be an Option object - if I do a gettype() on it it simply returns 'object'.
function productAction()
{
Zend::loadFile('Option.php', '../lib/ForwardOrder/');
....
$option = new Option($currentOpt, $choices);
....
}
Should I be using a different handler to include the Option class within the controller? Or should I be creating an Option object and adding it to the registry in my index.php? Or something else entirely?
I'm at a bit of a cross roads here and don't really want to have to start completely recoding things....