I have the following code in Welcome_Controller action_index method:
$route = new Route('(<controller>(/<action>(/<id>)))');
$body = $route->uri(array(
'controller' => 'welcome',
'action' => 'index',
'id' => '10'
));
echo Debug::vars($body);
When $route->uri method is called, I am getting an error:
ErrorException [ Fatal Error ]: Function name must be a string in SYSPATH/classes/Kohana/Route.php [ 589 ]
584 }
585
586 return array($result, $required);
587 };
588
589 list($uri) = $compile($this->_uri, TRUE);
590
591 // Trim all extra slashes from the URI
592 $uri = preg_replace('#//+#', '/', rtrim($uri, '/'));
593
594 if ($this->is_external())
Why am I getting this error? According to Kohana install.php file, my environment passed all requirements.
$compile is an anonymous function, but according to PHP Manual there were introduced in PHP 5.3.0 version, which I have on my hosting environment. Maybe there is an option to enable/disable anonymous functions in PHP?
You can find whole code here: https://github.com/DamianKedzior/kohana/tree/3.3/route_uri_exception