Ditching Tools

Permalink
Per Andrews blog, tools is deprecated in favor of keeping it in the controller.

So, I'm making a block that does an ajax call (within add/edit), previously to a tool file, what's the best way of doing that? I thought of using $this->action() to run a function in the controller, but that only works on edit/view.

Vivid
 
A3020 replied on at Permalink Reply
A3020
I'd add a custom route and point that to a method in your block controller. Optionally you can load a custom view in that method.

You can set up a route in your Package controller, Block controller or whatever like this:

Route::register('/some/custom/path',
   '\Application\Blocks\SomeBlock\Controller::someMethod');