> (on Friday, 12 December 2008, 12:13 PM +0100):
>> It's just me or in the ZF 1.7.0 the method renderElement() will
>> raise an
>> Exception?
>
> renderElement() has never existed. In 1.6.0, we added __call() to
> Zend_Form_Element, and have it capturing methods that start with
> 'render'; if the remainder of the method name matches an attached
> decorator, it then renders that decorator. If it doesn't match, then
> an
> exception is thrown.
Ok ok, sorry :) yes it isn't a method, however I have find the
renderElement() at this URL:
http://framework.zend.com/issues/browse/ZF-3217
renderLabel(), renderErrors() and renderDescription() works fine, but
no renderElement() so I use renderViewHelper().
>> I've just found that, instead, using renderViewHelper() will work
>> correctly (even for dijit elements)
>
> That *shouldn't* work for Dijits -- they don't have that decorator by
> default. I've also just verified this, by the way -- an exception was
> thrown. Are you by any chance attaching the ViewHelper decorator to
> your
> dijit elements?
You're right (sorry), but instead, for dijit elements, renderElement()
works!
standard --> renderViewHelper()
dijit --> renderElement()
But I have another problem, as write before in another thread:
How I can display the Description for a ComboBox (dijit) field? (ZF
1.7.0)
This is my code:
$this->addElement('ComboBox', 'test', array(
'label' => 'Test:',
'description' => 'Lorem ipsum dolor sit amet',
'required' => true,
'multiOptions' => array('alfa','bravo','charlie','delta')
));
And I've no description printed at all...
With this code:
$this->test->addDecorator('Description');
The description will be printed, but outside the <dd> tag
And with this code:
$this->test->setDecorators(array(
'ViewHelper',
'Description',
'Errors',
array('HtmlTag', array('tag' => 'dd')),
array('Label', array('tag' => 'dt'))
));
The description are printed inside the <dd> tags and all are fine, but
the ComboBox show NO OPTIONS at all...
Thanks
>
>> Il giorno 07/mag/08, alle ore 14:32, Matthew Weier O'Phinney ha
>> scritto:
>>
>>> A number of users have reported that they'd like syntax like the
>>> following in Zend_Form:
>>>
>>> <table>
>>> <tr>
>>> <td><?= $this->form->foo->renderLabel() ?></td>
>>> <td>
>>> <?= $this->form->foo->renderElement() ?>
>>> <?= $this->form->foo->renderDescription() ?>
>>> <?= $this->form->foo->renderErrors() ?>
>>> </td>
>>> </tr>
>>> </table>
>>>
>>> The idea is that they would like to selectively render specific
>>> metadata
>>> from the element or form.
>>>
>>> This could be done fairly easily by using overloading. __call()
>>> could
>>> intercept methods beginning in 'render', and if the remainder of the
>>> method matches a decorator, would render that decorator.
>>>
>>> I've created an issue to track this, and you can view it at:
>>>
>>> http://framework.zend.com/issues/browse/ZF-3217
>>>
>>> Please comment, if you are interested in the idea.
>>>
>>> --
>>> Matthew Weier O'Phinney
>>> Software Architect | matthew@zend.com
>>> Zend - The PHP Company | http://www.zend.com/
>>>
>>
>> ---
>> Emanuele Deserti
>> Netwing S.r.l.
>> <emanuele.deserti@netwing.it>
>> Tel. 0532-1915183
>> http://www.netwing.it
>>
>
> --
> Matthew Weier O'Phinney
> Software Architect | matthew@zend.com
> Zend Framework | http://framework.zend.com/
>
---
Emanuele Deserti
Netwing S.r.l.
<emanuele.deserti@netwing.it>
Tel. 0532-1915183
http://www.netwing.it
没有评论:
发表评论