本文整理汇总了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;
}