当前位置: 首页>>代码示例>>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;未经允许,请勿转载。