lithium\net\http\Router::_parseString()
Helper function for taking a path string and parsing it into a controller and action array.
Parameters
-
string
$path
Path string to parse i.e.
li3_bot.Logs::index
orPosts::index
. -
object
$context
Returns
arraySource
protected static function _parseString($path, $context, array $options = []) {
if (!preg_match('/^[A-Za-z0-9._\\\\]+::[A-Za-z0-9_]+$/', $path)) {
$base = rtrim($options['base'], '/');
if ((!$path || $path[0] != '/') && $context && isset($context->controller)) {
$formatters = static::formatters();
$base .= '/' . $formatters['controller']($context->controller);
}
$path = trim($path, '/');
return "{$base}/{$path}";
}
list($controller, $action) = explode('::', $path, 2);
return compact('controller', 'action');
}