mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 08:02:17 +00:00
Bugfixes
This commit is contained in:
@@ -4,9 +4,8 @@ namespace Pecee\SimpleRouter;
|
||||
use Pecee\Exception\RouterException;
|
||||
use Pecee\Http\Request;
|
||||
|
||||
class RouterResource extends RouterEntry implements ILoadableRoute, IControllerRoute {
|
||||
class RouterResource extends LoadableRoute implements IControllerRoute {
|
||||
|
||||
protected $url;
|
||||
protected $controller;
|
||||
|
||||
public function __construct($url, $controller) {
|
||||
@@ -15,7 +14,7 @@ class RouterResource extends RouterEntry implements ILoadableRoute, IControllerR
|
||||
}
|
||||
|
||||
public function renderRoute(Request $request) {
|
||||
if(is_object($this->getCallback()) && is_callable($this->getCallback())) {
|
||||
if($this->getCallback() !== null && is_callable($this->getCallback())) {
|
||||
// When the callback is a function
|
||||
call_user_func_array($this->getCallback(), $this->getParameters());
|
||||
} else {
|
||||
@@ -97,22 +96,6 @@ class RouterResource extends RouterEntry implements ILoadableRoute, IControllerR
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getUrl() {
|
||||
return $this->url;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $url
|
||||
* @return static
|
||||
*/
|
||||
public function setUrl($url) {
|
||||
$this->url = rtrim($url, '/') . '/';
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user