Let me just jump right into the code and explain what I would like to hear your thoughts about.
Code: Select all
/**
* Zodiac_Form
*
* @category Zodiac
* @package Zodiac_Form
* @author John Cartwright
* @published September 2007
*/
final class Zodiac_View_Helper_Form extends Zodiac_Form_Options
{
/**
* Form
* Primary function for view helper class
*
* @returns (object) self
*/
public function form()
{
return $this;
}
/**
*
* Snip Snip...
*
*/
/**
* __call
* Gateway function for rerouting to form element renderer
*
* @returns (string)
*/
public function __call($method, array $options)
{
return Zodiac_Form_Factory::get($method)->render($this->_parseOptions($options));
}
}So this means that I am forced to return an instance of Zodiac_View_Helper_Form object when the helper is called, then using a fluent interface call the right function..
Code: Select all
//what I have to do now
$this->form()->input('name');
//what I want to do now
$this->form->input('name');Bonus Question: Whats the best way to acquire the request object into a view helper in this case? To simply tuck it into Zend_View then using setView() in my helper class to acquire it?