mirror of
https://github.com/skipperbent/simple-php-router.git
synced 2026-07-11 01:52:16 +00:00
Re-added missing methods from version 1.
This commit is contained in:
@@ -168,6 +168,20 @@ abstract class RouterEntry {
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns callback name/identifier for the current route based on the callback.
|
||||
* Useful if you need to get a unique identifier for the loaded route, for instance
|
||||
* when using translations etc.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getIdentifier() {
|
||||
if(strpos($this->callback, '@') !== false) {
|
||||
return $this->callback;
|
||||
}
|
||||
return 'function_' . md5($this->callback);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set allowed request methods
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user