Co-authored-by: Marc Jauvin <marc.jauvin@gmail.com>
Co-authored-by: Luke Towers <luke@luketowers.ca>
Adds default views for the following backend controller behaviors:
- FormController
- ImportExportController
- ListController
- ReorderController
`Backend\Classes\ControllerBehavior` will now automatically append their `views` folder to the controller's view paths allowing them to provide fallbacks for any views required by the behavior.
The `create:controller` command will now no longer generate the views by default unless `--stubs` is also passed and the `--sidebar` flag is replaced with a `--layout=(standard|sidebar|fancy)` option to choose the form layout to use.
Also:
- Added `appendViewPath()` and `prependViewPath()` to the `System\Traits\ViewMaker`. `addViewPath` is renamed to `prependViewPath()` and is for paths that have higher priority than the existing paths while `appendViewPath()` is for paths that should have lower priority than the existing paths (i.e. fallbacks).
- Backend controllers will now automatically set their navigation context in the form of `Author.Plugin` as the author, `$pluginName` as the main menu code, and `$controllerName` as the side menu code. This means that you can remove calls to `BackendMenu::setContext()` and constructor overrides in your controllers if they follow that convention.
- Support for passing `new: true` as a parameter in the request body to `onSave()` calls that will return a redirect to the `create` action
- `formMakePartial(string $partial, array $params = [])` to the `FormController` behavior that will render a partial through the controller's `makePartial` using the following priority list of contextual names: `form_$context_$partial`, `form_$partial`, `$partial`).
- Support for `abort(403)` to return the access denied view in the backend
- Improved handling of `abort(404)` in the backend
- Improved styling of disabled fields in the fancy form layout
- Improved styling of file generated / updated status message in scaffolding commands