1

I'm using Kohana framework v3.3.1. Here's the default route in my bootstrap.php,

Route::set('default', '(<controller>(/<action>(/<id>)))')
->filter(
    function(\Route $route, $params, \Request $request) {
        $params['action'] = str_replace('-', '_', $params['action']);
        return $params;
    }
)
->defaults(array(
        'controller' => 'home',
        'action' => 'index',
    ));

Whenever I add "filter" to the route, I get the following error,

Fatal error: Uncaught Kohana_Exception [ 0 ]: Invalid Route::callback specified ~ SYSPATH/classes/Kohana/Route.php [ 391 ] thrown in /system/classes/Kohana/Route.php on line 391

The same code works fine in my localhost (ubuntu 14.04) but doesn't work in Bluehost. Any help would be greatly appreciated.

1 Answers1

1

Figured it out. Though bluehost implements PHP v5.4, code corresponding to v5.2 only works.

Route::set('testing', 'foo')
->filter(array('Class', 'method_to_process_my_uri'));

Reference: Kohana v3.3 User Guide