pastebin - collaborative debugging
pastebin is a collaborative debugging tool allowing you to share
and modify code snippets while chatting on IRC, IM or a message board.
This site is developed to XHTML and CSS2 W3C standards.
If you see this paragraph, your browser does not support those standards and you
need to upgrade. Visit WaSP
for a variety of options.
class DecorsController extends Zend_Controller_Action
{
public function indexAction()
{
$this->getHelper('ViewRenderer')->setNoRender(true);
'ViewHelper',
'Label',
'Errors',
);
'ViewHelper',
array(array('elemWrap' =>
'HtmlTag'),
array('tag' =>
'div',
'class' =>
'checkbox-wrap')),
array('Description',
array('tag' =>
'label',
'placement' =>
'prepend')),
'Errors',
);
'ViewHelper',
array('HtmlTag',
array('tag' =>
'li',
'class' =>
'button'))
);
'FormElements',
array('HtmlTag',
array('tag' =>
'ul',
'class' =>
'list-form')),
'Form'
);
'Label',
array(array('labelTd' =>
'HtmlTag'),
array('tag' =>
'td',
'class' =>
'labelWrap')),
array(array('elemTdOpen' =>
'HtmlTag'),
array('tag' =>
'td',
'openOnly' =>
true,
'placement' =>
'append')),
'ViewHelper',
'Errors',
array(array('elemTdClose' =>
'HtmlTag'),
array('tag' =>
'td',
'closeOnly' =>
true,
'placement' =>
'append')),
);
array(array('labelTd' =>
'HtmlTag'),
array('tag' =>
'td',
'class' =>
'labelWrap')),
array(array('elemTdOpen' =>
'HtmlTag'),
array('tag' =>
'td',
'openOnly' =>
true,
'placement' =>
'append')),
'ViewHelper',
'Errors',
array(array('elemTdClose' =>
'HtmlTag'),
array('tag' =>
'td',
'closeOnly' =>
true,
'placement' =>
'append')),
);
'Description',
array(array('labelTd' =>
'HtmlTag'),
array('tag' =>
'td',
'class' =>
'labelWrap')),
array(array('elemTdOpen' =>
'HtmlTag'),
array('tag' =>
'td',
'openOnly' =>
true,
'placement' =>
'append')),
'ViewHelper',
array(array('elemTdClose' =>
'HtmlTag'),
array('tag' =>
'td',
'closeOnly' =>
true,
'placement' =>
'append')),
);
'FormElements',
array('HtmlTag',
array('tag' =>
'table',
'class' =>
'table-form')),
'Form'
);
array(array('ddOpen' =>
'HtmlTag'),
array('tag' =>
'dd',
'openOnly' =>
true,
'placement' =>
'append')),
'ViewHelper',
'Errors',
array(array('ddClose' =>
'HtmlTag'),
array('tag' =>
'dd',
'closeOnly' =>
true,
'placement' =>
'append')),
);
array(array('ddOpen' =>
'HtmlTag'),
array('tag' =>
'dd',
'openOnly' =>
true,
'placement' =>
'append')),
'ViewHelper',
'Errors',
array(array('ddClose' =>
'HtmlTag'),
array('tag' =>
'dd',
'closeOnly' =>
true,
'placement' =>
'append')),
);
array(array('ddOpen' =>
'HtmlTag'),
array('tag' =>
'dd',
'openOnly' =>
true,
'placement' =>
'append')),
'ViewHelper',
array(array('ddClose' =>
'HtmlTag'),
array('tag' =>
'dd',
'closeOnly' =>
true,
'placement' =>
'append')),
);
'FormElements',
array('HtmlTag',
array('tag' =>
'div',
'class' =>
'dl-form')),
'Form'
);
$text =
new Zend_Form_Element_Text
('foo',
array('label' =>
'Foo:'));
$select =
new Zend_Form_Element_Select
('bar',
array('label' =>
'Bar:'));
$select->
setMultiOptions(array('one',
'two',
'three'));
$textarea =
new Zend_Form_Element_Textarea
('baz',
array('label' =>
'Baz:'));
$checkbox =
new Zend_Form_Element_Checkbox
('bat',
array('description' =>
'What?',
'label' =>
'Yes'));
$radio =
new Zend_Form_Element_Radio
('quux',
array('description' =>
'Choose one:'));
$radio->
setMultiOptions(array('first',
'second',
'third'));
$submit =
new Zend_Form_Element_Submit
('submit',
array('label' =>
'Submit'));
$elements =
array($text,
$select,
$textarea,
$checkbox,
$radio,
$submit);
foreach ($elements as $elem) {
$elem->addError('some error');
}
$form = new Zend_Form();
$form->addElements($elements);
$text->setDecorators($elementLi);
$select->setDecorators($elementLi);
$textarea->setDecorators($elementLi);
$checkbox->setDecorators($checkboxLi);
$radio->setDecorators($checkboxLi);
$submit->setDecorators($buttonLi);
$form->setDecorators($formUl);
$text->setDecorators($elementTr);
$select->setDecorators($elementTr);
$textarea->setDecorators($elementTr);
$checkbox->setDecorators($checkboxTr);
$radio->setDecorators($checkboxTr);
$submit->setDecorators($buttonTr);
$form->setDecorators($formTable);
$text->setDecorators($elementDl);
$select->setDecorators($elementDl);
$textarea->setDecorators($elementDl);
$checkbox->setDecorators($checkboxDl);
$radio->setDecorators($checkboxDl);
$submit->setDecorators($buttonDl);
$form->setDecorators($formDl);
}
}
Submit a correction or amendment below (click here to make a fresh posting)After submitting an amendment, you'll be able to view the differences between the old and new posts easily.