本文整理匯總了PHP中eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest::setPathinfo方法的典型用法代碼示例。如果您正苦於以下問題:PHP SimplifiedRequest::setPathinfo方法的具體用法?PHP SimplifiedRequest::setPathinfo怎麽用?PHP SimplifiedRequest::setPathinfo使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類eZ\Publish\Core\MVC\Symfony\Routing\SimplifiedRequest
的用法示例。
在下文中一共展示了SimplifiedRequest::setPathinfo方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: reverseMatch
/**
* Returns matcher object corresponding to $siteAccessName or null if non applicable.
*
* Limitation: If the element number is > 1, we cannot predict how URI segments are expected to be built.
* So we expect "_" will be reversed to "/"
* e.g. foo_bar => foo/bar with elementNumber == 2
* Hence if number of elements is different than the element number, we report as non matched.
*
* @param string $siteAccessName
*
* @return \eZ\Publish\Core\MVC\Symfony\SiteAccess\Matcher\URIElement|null
*/
public function reverseMatch($siteAccessName)
{
$elements = $this->elementNumber > 1 ? explode('_', $siteAccessName) : array($siteAccessName);
if (count($elements) !== $this->elementNumber) {
return null;
}
$pathinfo = '/' . implode('/', $elements) . '/' . ltrim($this->request->pathinfo, '/');
$this->request->setPathinfo($pathinfo);
return $this;
}