Helper: admin/util/extended

« All helpers

Extends a form with a "Custom Fields" section that displays inputs for any ExtendedModel-based class.


1. Call the helper

Add this to your form view template:

{! admin/util/extended?extends=blog\Post&name=Blog+Posts !}

For update forms, pass the extended field values as well:

{! admin/util/extended?extends=blog\Post&name=Blog+Posts&values=[extra|none]&id=[id] !}

2. Call ->update_extended() on your ExtendedModel

For update forms, call this in the form handler function, before calling $post->put ():

$post->update_extended ();

3. Add a link to manage the custom fields

Create a link to edit the custom fields for a given class somewhere in your app:

<a href="/admin/extended?extends=blog\Post&name=Blog Posts">{"Custom Fields"}</a>