| | 1 | = How To Add A Scaffold = |
| | 2 | |
| | 3 | To add a scaffold: |
| | 4 | |
| | 5 | 1. Add a table to your database. At present, it (and any tables it uses in relationships) may only have one column acting as a primary key. For the sake of example, we'll pretend we've added a table named "Contact" |
| | 6 | 1. If the table is related to other tables in a one-to-many or many-to-many manner, add those relationships to the Reactor.xml file using <object>, <hasMany>, <hasOne>, and related tags. Full documentation for this is available in Reactor's documentation. |
| | 7 | 1. Add the following tag to your !ModelGlue.xml: |
| | 8 | |
| | 9 | {{{ |
| | 10 | <scaffold object="contact" /> |
| | 11 | }}} |
| | 12 | |
| | 13 | By default, this will create the following event handlers: |
| | 14 | |
| | 15 | 1. Contact.List - Lists all contacts from the contact table |
| | 16 | 1. Contact.View - Displays a specific contact in a read-only manner |
| | 17 | 1. Contact.Edit - Provides a form to edit a contact |
| | 18 | 1. Contact.Commit - Saves a contact to the database |
| | 19 | 1. Contact.Delete - Deletes a given contact |