本文整理汇总了PHP中eZURLAliasML::actionToUrl方法的典型用法代码示例。如果您正苦于以下问题:PHP eZURLAliasML::actionToUrl方法的具体用法?PHP eZURLAliasML::actionToUrl怎么用?PHP eZURLAliasML::actionToUrl使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZURLAliasML
的用法示例。
在下文中一共展示了eZURLAliasML::actionToUrl方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: translate
//.........这里部分代码省略.........
$link = $pathRow[$table . "_link"];
$text = $pathRow[$table . "_text"];
$isAlias = $pathRow[$table . '_is_alias'];
$aliasRedirects = $pathRow[$table . '_alias_redirects'];
$verifiedPath[] = $text;
if ($i == $len - 1) {
$action = $pathRow[$table . "_action"];
}
if ($link != $id) {
$doRedirect = true;
} else {
if ($isAlias && $action !== false) {
if ($aliasRedirects) {
// If the entry is an alias and we have an action we redirect to the original
// url of that action.
$redirectAction = $action;
$doRedirect = true;
}
}
}
$lastID = $link;
}
if (!$doRedirect) {
$verifiedPathString = implode('/', $verifiedPath);
// Check for case difference
if ($prefixAdded) {
if (strcmp($originalURIString, substr($verifiedPathString, strlen($prefix) + 1)) != 0) {
$doRedirect = true;
}
} else {
if (strcmp($verifiedPathString, $internalURIString) != 0) {
$doRedirect = true;
}
}
}
if (preg_match("#^module:(.+)\$#", $action, $matches) and $doRedirect) {
$uriString = 'error/301';
$return = $matches[1];
} else {
if ($doRedirect) {
if ($redirectAction !== false) {
$query = "SELECT id FROM ezurlalias_ml WHERE action = '" . $db->escapeString($action) . "' AND is_original = 1 AND is_alias = 0";
$rows = $db->arrayQuery($query);
if (count($rows) > 0) {
$id = (int) $rows[0]['id'];
} else {
$id = false;
$uriString = 'error/301';
$return = join("/", $pathData);
}
} else {
$id = (int) $lastID;
}
if ($id !== false) {
$pathData = array();
// Figure out the correct path by iterating down the parents until we have all
// elements figured out.
while ($id != 0) {
$query = "SELECT parent, lang_mask, text FROM ezurlalias_ml WHERE id={$id}";
$rows = $db->arrayQuery($query);
if (count($rows) == 0) {
break;
}
$result = eZURLAliasML::choosePrioritizedRow($rows);
if (!$result) {
$result = $rows[0];
}
$id = (int) $result['parent'];
array_unshift($pathData, $result['text']);
}
$uriString = 'error/301';
$return = join("/", $pathData);
}
// Remove prefix of redirect uri if needed
if ($prefix && is_string($return)) {
if (strncasecmp($return, $prefix . '/', strlen($prefix) + 1) == 0) {
$return = substr($return, strlen($prefix) + 1);
}
}
} else {
// See http://issues.ez.no/19062
// If $uriString matches a nop action, we need to check if we also match a wildcard
// since we might want to translate it.
// Default action for nop actions is to display the root node "/" (see eZURLAliasML::actionToURL())
if (strpos($action, 'nop') !== false && eZURLWildcard::wildcardExists($uriString)) {
$return = false;
} else {
$uriString = eZURLAliasML::actionToUrl($action);
$return = true;
}
}
}
if ($uri instanceof eZURI) {
$uri->setURIString($uriString, false);
} else {
$uri = $uriString;
}
}
return $return;
}
示例2: actionURL
function actionURL()
{
return eZURLAliasML::actionToUrl($this->Action);
}