In Asp.Net MVC I have used helpers to specify paths to actions and controllers, like this:
var url = "@Url.Action("OrderAction", "OrderController")";
$.post(url, { name: name, prodno: prodno }, function(data) {
//Do stuff
});
Now I’m trying to learn Kohana and php, and I was wondering if there is a similar way to do it there? Or how else do I call a specific action method in a controller to post to it?
EDIT: Here’s the routing in bootstrap.php if it helps:
Route::set('default', '(<controller>(/<action>(/<id>)))')
->defaults(array(
'controller' => 'home',
'action' => 'index',
));
You can use Reverse Routing to transform a route and optional arguments to the link…