|
|||
|
Hi all,
I have read a lot of documentation, tutorials, and experimented a lot. However, I ran into a snag... I have the following in my ini configuration file. elementdecorators.decorator = "ViewHelper" elementdecorators.datatag.decorator = "HtmlTag" elementdecorators.datatag.options.tag = "<td>" elementdecorators.label.decorator = "Label" elementdecorators.label.options.tag = "<th>" elementdecorators.rowtag.decorator = "HtmlTag" elementdecorators.rowtag.options.tag = "<tr>" When I apply it to my form, it loads, but does not render correctly. The problem is that I have two HtmlTag decorators and the '<tr>' overwrites the '<td>'. How do you alias a decorator in a configuration file? This Document says you can do alieses if you want multiple of the same decorator, but I've never seen it done in a config file. The following was my original code, it renders like I expect (and want). $this->setElementDecorators( array( array('ViewHelper'), // prints the element array( array('datatag' => 'HtmlTag'), array('tag' => '<td>' )), // wrap the element in a <dt> array('Label', array('tag' => '<th>')), // prepend the label and wrap it in a <th> array('HtmlTag', array('tag' => '<tr>')) // wrap the whole thing in a <tr> ) ); I want to use this decorator on many custom forms without having to copy and paste. I though about making my own decorator, but that seemed like overkill for this (and it looks much more complicated). Thanks for any help. Is there another good way to store default configuration? Last edited by qhas : 04-07-2008 at 10:36 PM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|