Skip to content

Instantly share code, notes, and snippets.

@stevelacey
Created March 13, 2011 18:32
Show Gist options
  • Save stevelacey/868312 to your computer and use it in GitHub Desktop.
Save stevelacey/868312 to your computer and use it in GitHub Desktop.
Add an auto-detected partial for form generator fieldset grouping help text. Goes in "data/generator/sfDoctrineModule/admin/template/templates/". Lets you describe a group of fields in a Symfony form, based on adding a partial to the module under the foll
<fieldset id="sf_fieldset_[?php echo preg_replace('/[^a-z0-9_]/', '_', strtolower($fieldset)) ?]">
[?php if ('NONE' != $fieldset): ?]
<h2>[?php echo __($fieldset, array(), '<?php echo $this->getI18nCatalogue() ?>') ?]</h2>
[?php endif; ?]
[?php if (is_readable('<?php echo sfConfig::get('sf_app_module_dir').'/'.$this->getModuleName() ?>/templates/_'.preg_replace('/[^a-z0-9_]/', '_', strtolower($fieldset)).'_help.php')): ?]
[?php include_partial('<?php echo $this->getModuleName() ?>/'.preg_replace('/[^a-z0-9_]/', '_', strtolower($fieldset)).'_help') ?]
[?php endif ?]
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment