當前位置: 首頁>>代碼示例>>PHP>>正文


PHP eZURLAliasML::actionToUrl方法代碼示例

本文整理匯總了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;
 }
開發者ID:patrickallaert,項目名稱:ezpublish-legacy-php7,代碼行數:101,代碼來源:ezurlaliasml.php

示例2: actionURL

 function actionURL()
 {
     return eZURLAliasML::actionToUrl($this->Action);
 }
開發者ID:patrickallaert,項目名稱:ezpublish-legacy-php7,代碼行數:4,代碼來源:ezpathelement.php


注:本文中的eZURLAliasML::actionToUrl方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。