I’m using symfony 1.4.3
Is there some way to render a sfWidgetFormChoice as an unordered list?
In the API there is an option called ‘renderer_class’ but I can’t find any documentation or example about it.
Thanks!
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
take a look at
lib/vendor/symfony/lib/widget/sfWidgetFormSelect.class.phpfor example. Basically, what you need to do is implement a class that extendssfWidgetFormChoiceBaseand write a methodrender()therein. A minimal example would look like this:You can put this in
/lib/widget/sfWidgetFormChoiceUnordered.class.php. Then you need to set therenderer_classoption on thesfWidgetFormChoicewidget like you already found out. Set it to the name of the class we just wrote:sfWidgetFormChoiceUnordered.Example:
For documentation on the arguments to
render(), check out the example class I posted above.