Tried to add
public function addElement($element, $name = null, $options = null)
    {
        if (!is_array($options)) {
            $options = array();
        }

        // A plugin loader is implicitly created if default decorators are
loaded
        $options['disableLoadDefaultDecorators'] = true;

        // Add the element to the form
        parent::addElement($element, $name, $options);

        // Configure the element to use the form's plugin loaders
        $element = $this->getElement($name);
        foreach ($this->_loaders as $type => $loader) {
            if ($type != 'ELEMENT') {
                $element->setPluginLoader($loader, $type);
            }
        }

        // Now load default decorators for the element
        $element->loadDefaultDecorators();

        return $this;
    }

to my form.

It says :

*Fatal error*: Call to a member function setPluginLoader() on a non-object
in
this line:
$element->setPluginLoader($loader, $type);

Regards,
Saša Stamenković


On Wed, Sep 30, 2009 at 9:24 AM, keith Pope <mute.p...@googlemail.com>wrote:

> You may want to look at this:
>
> http://ishouldbecoding.com/tag/zend-framework
>
> Theres a post about Zend_Form and the Pluginloader, it shows a way to
> reduce the amount of plugin loader instances.
>
> 2009/9/30 Саша Стаменковић <umpir...@gmail.com>:
> > But he can cache rendered content, then time will be spent just on
> pulling
> > html from cache (shooting in the dark) ;)
> > I would try both and do some benchmarking - plz share the results.
> >
> > Regards,
> > Saša Stamenković
> >
> >
> > On Wed, Sep 30, 2009 at 8:25 AM, Peter Warnock <petewarn...@gmail.com>
> > wrote:
> >>
> >> I would only cache if it's visibly slow, or you're running out of
> memory.
> >> If you're going to cache, cache the output since most of the overhead is
> >> used in rendering. Keep in mind, you lose the ability to pre-populate
> the
> >> form.
> >> - pw
> >>
> >> On Mon, Sep 28, 2009 at 4:49 AM, holografix . <hologra...@gmail.com>
> >> wrote:
> >>>
> >>> Hi
> >>>
> >>> I have several complex forms in the application and I would like to
> know
> >>> if there is any benefit in caching those forms.
> >>> If so, what would be the best way to go? Cache the classes or the
> output
> >>> of the forms?
> >>>
> >>> Cheers
> >>> holo
> >>
> >
> >
>

Reply via email to