octobercms/october — pull request #590 by MilosStanic (2014-08-28 16:41:12+00:00)
Title: Update FormController.php

This edit will enable using other fields in URL when creating or updating.
In my case, I have a relationship of Tutorials that have many Pages
When I add new Pages to a Tutorial, I need to be able to redirect back to Tutorial/update page, which shows properties of tutorial and a list of Pages that belong.
So, in my Pages controller dir, I have a config_form.yaml file for my Pages like this:

```
name: page
form: @/plugins/zamst/educatormgr/models/page/fields.yaml
modelClass: Zamst\EducatorMgr\Models\Page
defaultRedirect: zamst/educatormgr/tutorials

create:
title: New Page
redirect: zamst/educatormgr/tutorials/update/:tutorial_id
redirectClose: zamst/educatormgr/tutorials/update/:tutorial_id
flash-save: Page has been created

update:
title: Edit Page
redirect: zamst/educatormgr/tutorials/update/:tutorial_id
redirectClose: zamst/educatormgr/tutorials/update/:tutorial_id
flash-save: Page has been successfully updated
flash-delete: Page has been deleted
```
In this case, :tutorial_id is not the primary key, but the link to the parent Tutorial model, so it can return to proper Tutorial update page.