Hi y'all,
I'm using a ViewScript decorator for my Zend_Form. In this form I'ld like each
third checkbox in a collection of checkboxes to start on a newline, or in a new
block element or something similar. I tried it with a MultiCheckbox.
I wish I could do something similar as beneath in my forms ViewScript:
<?
$c = 1;
foreach( $this->element->myMultiCheckbox as $checkbox )
{
$separator = $c % 2 == 0 ? '<br>' : '';
echo $checkbox->renderViewHelper() . $separator;
$c++;
}
?>
But sadly this doesn't seem possible. My next option I think would be to use
seperate Checkbox elements with the multiple [] indicator in their names. But I
have no idea how I would be able to loop through them in my ViewScript either.
Do you perhaps have any hints on how I could achieve this?
Also, with the Zend_Form ViewScript decorator, I thought I would be able to
access the form object with something like $this->form from within the view.
But I'm not able to access it. How would I be able to access for instance
Zend_Form::getMethod(), Zend_Form::getEncType() and other (userland) attributes
from within the ViewScript?
Thank you for your pointers.
_________________________________________________________________
Blijf altijd op de hoogte van wat jouw vrienden doen
http://home.live.com