本文整理匯總了PHP中FWValidator::hasProto方法的典型用法代碼示例。如果您正苦於以下問題:PHP FWValidator::hasProto方法的具體用法?PHP FWValidator::hasProto怎麽用?PHP FWValidator::hasProto使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FWValidator
的用法示例。
在下文中一共展示了FWValidator::hasProto方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: getPathByTarget
/**
* Returns the page path of the given target (node placeholder).
* If the target page doesn't exist, the path of the error page will be returned.
*
* @param array $arguments
* @return string $path
*/
public function getPathByTarget($arguments)
{
global $_CONFIG;
$target = contrexx_input2raw($arguments['get']['target']);
if (!\FWValidator::hasProto($target)) {
$page = new \Cx\Core\ContentManager\Model\Entity\Page();
$page->setTarget($target);
if ($page->isTargetInternal()) {
$target = str_replace(array('[[', ']]'), array('{', '}'), $target);
\LinkGenerator::parseTemplate($target);
} elseif (ASCMS_PATH_OFFSET == '' || strpos($target, ASCMS_PATH_OFFSET) === false) {
if (!isset($target[0]) || $target[0] !== '/') {
$target = '/' . $target;
}
$target = ASCMS_PATH_OFFSET . $target;
}
$target = ASCMS_PROTOCOL . '://' . $_CONFIG['domainUrl'] . $target;
}
return $target;
}