Colin J wrote:
>
> Hi Mark
>
> I'm not sure if this is relevant in your case because it depends on what
> you are doing in your viewScript, but I found that rendering the element
> like this:
>
> <?php echo $this->{$this->element->helper}(
> $this->element->getName(),
> $this->element->getValue(),
> $this->element->getAttribs()
> );
>
> does NOT get the array notation. You need to use the
> getFullyQualifiedName() method, like this:
>
> <?php echo $this->{$this->element->helper}(
> $this->element->getFullyQualifiedName(),
> $this->element->getValue(),
> $this->element->getAttribs()
> );
>
> As I say, not sure if this is what you are doing in the viewScript, so it
> may not be appropriate.
>
> Regards
>
> Colin
>
>
> lightflowmark wrote:
>>
>> Sorry to resurrect an old thread, but I was searching for a solution to
>> my problem and came across this. I'm trying to get (Dojo) subform
>> elements rendered with a ViewScript decorator to have their
>> fully-qualified names, i.e. with the subform array notation.
>>
>> I'm using the example for the docs, which is something like
>> ....
>> $textForm = new Zend_Dojo_Form_SubForm();
>> ....
>> $textForm->addElement(
>> 'DateTextBox',
>> 'datebox',
>> array(
>> 'value' => '2008-07-05',
>> 'label' => 'DateTextBox',
>> 'required' => true,
>> )
>> ....
>>
>>
>> And I've added:
>> $textForm->getElement('datebox')
>> //->clearDecorators
>> ->setDecorators(array(
>> 'PrepareElements',
>> array('ViewScript', array(
>> 'viewScript' =>
>> 'someAction/_someAction-form-element.phtml',
>> 'class' => 'someClassName'
>> ))));
>>
>>
>> But I'm still not getting the array notation on the input name - the
>> PrepareElements decorator is having no effect at all.
>>
>> Does anyone have any advice?
>>
>> Thanks,
>> Mark
>>
>>
>>
>
>
--
View this message in context: http://www.nabble.com/view-script-and-subform-nested-tp22096665p22158146.html
Sent from the Zend MVC mailing list archive at Nabble.com.
没有评论:
发表评论