Created
June 28, 2011 22:51
-
-
Save typeoneerror/1052453 to your computer and use it in GitHub Desktop.
decorator hell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Load the default decorators for forms. | |
* | |
* @return Typeoneerror_Form Reference to form instance | |
*/ | |
public function loadDefaultDecorators() | |
{ | |
// wipe all | |
$this->clearDecorators(); | |
// just add form elements | |
$this->addDecorator("FormElements") | |
->addDecorator("Form"); | |
// form and fieldsets for groups | |
$this->setDisplayGroupDecorators(array( | |
"FormElements", | |
array("HtmlTag", array( | |
"class" => "fieldset-wrapper", | |
"tag" => "div", | |
)), | |
"Fieldset", | |
)); | |
return $this; | |
} | |
/** | |
* Adds default decorators to the form elements. | |
* | |
* @return Typeoneerror_Form | |
*/ | |
public function loadDefaultElementDecorators() | |
{ | |
$this->setElementDecorators(array( | |
"ViewHelper", | |
"Errors", | |
array("Label"), | |
array("HtmlTag", array( | |
"tag" => "div", | |
"class" =>"element", | |
)), | |
)); | |
return $this; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment