Re-added missing methods from version 1.

This commit is contained in:
Simon Sessingø
2016-11-17 17:55:34 +01:00
parent 99f869b57d
commit a4447313f6
2 changed files with 113 additions and 91 deletions
+14
View File
@@ -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
*