If you need to customize a page, you can inherit from the base controller. All pages of the backend panel inherit from this object, which provides all the methods required by the resource
route. You can implement these methods as needed. If an unimplemented method is requested, an exception will be thrown.
You can view the base controller source code for more information.
Method | Description |
---|---|
render(data, options) | Render amis object as HTML code |
ok(data, msg) | Return success response |
fail(msg, code) | Return failure response |
index() | Page rendering or list data |
create() | Create page construction |
edit() | Edit page construction |
show() | Detail page construction |
store() | Create data |
update() | Update data |
destroy() | Delete data |
If your controller needs to handle CRUD operations for resources, you can inherit from the resource controller, which includes all the methods of the base controller. It also additionally implements the crud
page and required interfaces.
You can view the resource controller source code for more information.
Method | Description |
---|---|
getFilters() | Get filter fields |
getForms() | Get form fields |
fields() | Build table fields |
forms() | Build form fields |
builder() | Page building method |
header() | Build page header |
footer() | Build page footer |
filters() | Build filter fields |
detail() | Build detail page |
creator() | Build create page |
editor() | Build edit page |
filter() | Build filter |
bulkActions() | Build bulk operation tools |
headerToolbar() | Build header toolbar |
footerToolbar() | Build footer toolbar |
actions() | Build row action buttons |
operations() | Build row operation column |
Name | Default Value | Description |
---|---|---|
showOperations | true | Show row operations |
showCreateButton | true | Show create button |
showDetailButton | true | Show detail button |
showEditButton | true | Show edit button |
showDeleteButton | true | Show delete button |
showBulkDeleteButton | true | Show bulk delete button |
showFilterToggler | true | Show filter toggler button |
showBulkActions | true | Show bulk actions toolbar |
repository | None | Resource repository |
defaultParams | { orderBy: 'id', orderDir: 'desc' } | Default request parameters |