To anyone who might be interested in how I managed this, I ended up implementing my own widget class for this purpose called "sfWidgetFormPlain.class.php". It extends sfWidgetForm, and overrides the render method to just return the value. Worked perfectly for what I need.
I'm ccing the dev list to see if there is any interest in this as a feature there. What do you think? Is this a use case that comes up often enough that a widget for this purpose would be useful? On Sat, Dec 27, 2008 at 3:20 PM, David Brewer <[email protected]> wrote: > I sometimes need to display a value in a form field which is not > editable but purely informational. For example, imagine a user class > with separate fields for first name, last name, middle name, title, > etc... I like to have an additional field "display name" which is a > custom getter that returns the formatted combination of those names. > In my admin console I need to display this field as plain text so the > user can see what they have done, but as it is generated it should not > be editable. > > Under the sf 1.0 admin generator I could do this with a "type: plain" > setting in generator.yml. What is the preferred way to handle this > situation using the new admin generator and forms framework? > > Thanks, > > David Brewer > [email protected] > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "symfony users" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/symfony-users?hl=en -~----------~----~----~----~------~----~------~--~---
