AnyMarkup Decorator
1 2 3 4 56 7 8 9 1011 12 13 14 1516 17 | <?php class My_Decorator_AnyMarkup extends Zend_Form_Decorator_Abstract { public function render($content) { $placement = $this->getPlacement(); $separator = $this->getSeparator(); switch ($placement) { case self::PREPEND: return $this->_options['markup'] . $separator . $content; case self::APPEND: default: return $content . $separator . $this->_options['markup']; } } } ?> |
Comments
You must login before commenting on a snippet. If you do not have an account, please register.
Snippet description
With the AnyMarkup decorator you can place arbitrary markup before or after other output.
Just put the key 'markup' in the decorator options somewhere and assign it some (valid) markup.
Use multiple instances of the decorator to wrap your content withy any markup. See http://devzone.zend.com/article/3450-Decorators-with-Zend_Form for a reference on using multiple instances of a decorator.
Snippet details
- Created:
-
chiborg
- Edited:
-
chiborg
- Revision Id:
- 116
- Edit Message:
- Initial Release
- ZF Version
- 1.8.3
- Tags:
- form decorator markup html
- Comments:
- 0
- Views:
- 256
- Points:
- 1 (1 votes)