lithium\net\http\Router::_parseString()

protected static method

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 or Posts::index.

  • boolean $context

Returns

array

Source

	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');
	}