Development

#5535 (Add 'inline_partial' option to admin generator fields, allowing use of partials with regular label and help text)

You must first sign up to be able to contribute.

Ticket #5535 (new enhancement)

Opened 6 months ago

Add 'inline_partial' option to admin generator fields, allowing use of partials with regular label and help text

Reported by: dbrewer Assigned to: fabien
Priority: minor Milestone:
Component: generator Version: 1.2.1
Keywords: Cc:
Qualification: Unreviewed

Description

I recently ported an extensive sf 1.0 admin console to the new sf 1.2 admin generator system. One difference I struggled with was that the sf 1.2 admin generator does not include the label or help text on partial fields. Sometimes this is good -- if you are making a partial which is so different from a regular field that you want to handle all of that yourself -- but most of the time I would like my partial to be able to take advantage of the label and help text defined in the generator.yml.

What I ended up doing to support this was creating an admin generator theme based on the standard sfDoctrinePlugin admin theme with a slight modification to _form_field.php. Essentially I added a new field option to the admin generator called "inline_partial". If this option is true, a regular form label and the help text are included. Otherwise, the behavior is as it was before. I thought I'd suggest an option like this as a core feature, since I can't imagine I'm the only one transitioning from 1.0 to 1.2 and running into this issue.

I will attach a diff from my admin generator theme showing exactly what I changed. I'm sure this could be done more elegantly by someone a little more intimately familiar with this system than I am.

Attachments

_form_field.diff (2.2 kB) - added by dbrewer on 01/05/09 19:33:28.
Diff showing updates made to _form_field.php partial to add inline_partial feature

Change History

01/05/09 19:33:28 changed by dbrewer

  • attachment _form_field.diff added.

Diff showing updates made to _form_field.php partial to add inline_partial feature

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.