Zend framework decorators question

2019-05-14 03:18发布

问题:

I need to add some random html content with text before and after my input field.

I know I can use description decorator and set escape option to false - this way I can simply inject arbitrary html chunk as a decorator.

But this only accounts for 1 html chunk - I need a second one after input field. If I simply output description decorator again after input field - that will output the same description chucnk.

1) Is there a way to use description decorator multiple times with different content?

2) In label decorator - is there a way to use span tag instead of label tag?

3) Can I inject random html into HtmlTag decorator?

thanks!

update: i solved my problem by creating simple custom decorator that allows me inject random html anywhere. Still -if someone knows quick and easy answers - plz post.

回答1:

You could check out the AnyMarkup decorator:

http://www.zfsnippets.com/snippets/view/id/62/anymarkup-decorator