当前位置: 首页>>代码示例>>PHP>>正文


PHP CComponentEngine::getComponent方法代码示例

本文整理汇总了PHP中CComponentEngine::getComponent方法的典型用法代码示例。如果您正苦于以下问题:PHP CComponentEngine::getComponent方法的具体用法?PHP CComponentEngine::getComponent怎么用?PHP CComponentEngine::getComponent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在CComponentEngine的用法示例。


在下文中一共展示了CComponentEngine::getComponent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: resolveSocNetPathComponentEngine

 /**
  * Resolves path in complex component (socialnetwork) and find target file or folder.
  * @param \CComponentEngine $engine Component engine.
  * @param array             $pageCandidates Page candidates.
  * @param array             &$variables Output variables.
  * @return int|string
  */
 public function resolveSocNetPathComponentEngine(\CComponentEngine $engine, $pageCandidates, &$variables)
 {
     $component = $engine->getComponent();
     if (!$component) {
         list($pageId, $variables) = each($pageCandidates);
         return $pageId;
     }
     $storage = null;
     foreach ($pageCandidates as $pageId => $variablesTmp) {
         if (!empty($variablesTmp["PATH"]) && is_string($variablesTmp["PATH"])) {
             $storage = $this->getStorageByVariables($variablesTmp);
             if (!$storage) {
                 return '';
             }
             $variables = array_merge($variablesTmp, $this->resolvePathToFolder($storage, $variablesTmp["PATH"]));
             if (empty($variables['FOLDER_ID'])) {
                 return '';
             }
             return $pageId;
         } elseif (!empty($variablesTmp["FILE_PATH"]) && is_string($variablesTmp["FILE_PATH"])) {
             $storage = $this->getStorageByVariables($variablesTmp);
             if (!$storage) {
                 return '';
             }
             $variables = array_merge($variablesTmp, $this->resolvePathToFile($storage, $variablesTmp["FILE_PATH"]));
             if (empty($variables['FILE_ID'])) {
                 return '';
             }
             return $pageId;
         } elseif (!empty($variablesTmp["TRASH_PATH"]) && is_string($variablesTmp["TRASH_PATH"])) {
             $storage = $this->getStorageByVariables($variablesTmp);
             if (!$storage) {
                 return '';
             }
             $variables = array_merge($variablesTmp, $this->resolvePathToTrashFolder($storage, $variablesTmp["TRASH_PATH"]));
             if (empty($variables['FOLDER_ID'])) {
                 return '';
             }
             return $pageId;
         } elseif (!empty($variablesTmp["TRASH_FILE_PATH"]) && is_string($variablesTmp["TRASH_FILE_PATH"])) {
             $storage = $this->getStorageByVariables($variablesTmp);
             if (!$storage) {
                 return '';
             }
             $variables = array_merge($variablesTmp, $this->resolvePathToTrashFile($storage, $variablesTmp["TRASH_FILE_PATH"]));
             if (empty($variables['FILE_ID'])) {
                 return '';
             }
             return $pageId;
         }
     }
     list($pageId, $variables) = each($pageCandidates);
     return $pageId;
 }
开发者ID:mrdeadmouse,项目名称:u136006,代码行数:61,代码来源:urlmanager.php


注:本文中的CComponentEngine::getComponent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。