Hello,
The add button URI of the grid is defined by the currently URL.
For example,
Current URL: xxx.com/admin/articles
URI of add button: /admin/articles/create
If I want to change the URI of add button to something like /admin/comments/create, how should I do?
I have this idea because I put 2 grid with different model in the same page. Each of them need their own URI path of the add button.
Thank you.
You can't customize the add button.
But you can remove the button by using $grid->disableCreation();, and add a custom tool for grid like following:
$grid->tools(function ($tools) {
$tools->append("<a href='your-create-URI' class='btn btn-default'>Create</a>");
});
Most helpful comment
You can't customize the add button.
But you can remove the button by using
$grid->disableCreation();, and add a custom tool for grid like following: