public function parseRequest($manager, $request)
{
if ($this->mode === self::CREATION_ONLY) {
return false;
}
if (!empty($this->verb) && !in_array($request->getMethod(), $this->verb, true)) {
return false;
}
$pathInfo = $request->getPathInfo();
if ($this->host !== null) {
$pathInfo = strtolower($request->getHostInfo()) . ($pathInfo === '' ? '' : '/' . $pathInfo);
}
$params = $request->getQueryParams();
$suffix = (string) ($this->suffix === null ? $manager->suffix : $this->suffix);
$treeNode = null;
if (!$pathInfo) {
return false;
}
if (!preg_match('/\\/(?<id>\\d+)\\-(?<code>\\S+)$/i', "/" . $pathInfo, $matches)) {
return false;
}
return ['cms/content-element/view', ['id' => $matches['id'], 'code' => $matches['code']]];
}