On Tuesday 09 June 2009 12:39:59 Dalibor Karlović wrote:
> I'm building a TinyMCE form element for which I've written a view helper
> (extends FormTextarea). It has stuff like setToolbarLocation() etc. What
> I'd like is to proxy these calls through the form element so I can say:
>
> $tinymce = $this->createElement('tinymce', 'content');
> $tinymce
>     ->setToolbarLocation('bottom');
>
> What is the best way to do this? I'd override __call() but can't figure out
> what to proxy to, as the view helper only gets inited in ViewHelper
> decorator.

Nevermind, I've figured it out. The fourth param passed to view helpers is 
$element->options, I've just overridden __call() in my Tinymce form element to 
modify it like:

$element->setToolbarLocation('top')

means

$options['toolbarLocation'] = 'top';

and added a setOptions(Array $options) to my view helper which sets everything 
up. Maybe it'll help someone. :)

-- 
Dado

Reply via email to