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


PHP URLBuilder::getCatalogLinkForTree方法代碼示例

本文整理匯總了PHP中URLBuilder::getCatalogLinkForTree方法的典型用法代碼示例。如果您正苦於以下問題:PHP URLBuilder::getCatalogLinkForTree方法的具體用法?PHP URLBuilder::getCatalogLinkForTree怎麽用?PHP URLBuilder::getCatalogLinkForTree使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在URLBuilder的用法示例。


在下文中一共展示了URLBuilder::getCatalogLinkForTree方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: mainTreeRender

 private function mainTreeRender(Tree &$tree, $selectedKey)
 {
     $li = new Li();
     $mainDiv = new Div();
     $mainDiv->addStyleClasses(["expand", "text_non_select", "tree_text_node", "input_hover"]);
     $table = new Table();
     $tr = new Tr();
     $nodeIcon = new Td();
     $nodeText = new Td();
     $nodeText->addStyleClass("tree_text");
     $nodeSearchCount = new Td();
     $nodeSearchCount->addStyleClass("tree_search_count");
     if (count($tree->childrens) > 0) {
         $nodeIcon->addStyleClasses(["tree_btn"]);
         $icon = new Img();
         $icon->addAttribute("style", "top: 2px; position: relative; margin: 0 5px;");
         $icon->addAttribute("src", $this->treeLevel <= $this->DEFAULT_TREE_LEVEL_TO_SHOW || $tree->show ? "images/arrow90.png" : "images/arrow00.png");
         $nodeIcon->addChild($icon);
     } else {
         $nodeIcon->addStyleClass("tree_empty");
     }
     $link = new A();
     $link->addAttribute("href", URLBuilder::getCatalogLinkForTree($tree->key));
     $link->addChild($tree->value);
     $link->addStyleClass("input_hover");
     $nodeSelected = new Div();
     $nodeSelected->addStyleClass($tree->key == $selectedKey ? 'selected' : 'tree_empty');
     $link->addChild($nodeSelected);
     $nodeText->addChild($link);
     return $li->addChild($mainDiv->addChild($table->addChild($tr->addChildList([$nodeIcon, $nodeText, $nodeSearchCount]))));
 }
開發者ID:gingerP,項目名稱:shop,代碼行數:31,代碼來源:TreeView.php

示例2: bottomTreeRender

 private function bottomTreeRender(Tree &$tree, $isRoot)
 {
     $children = count($tree->childrens);
     $span = new Li();
     $mainDiv = new Div();
     $span->addStyleClass($isRoot);
     /*if ($children == 0) {*/
     $mainDiv = new A();
     $span->addChild($mainDiv);
     $mainDiv->addStyleClasses(["f-17", "cursor_pointer", "bottom_tree_hover", "label"]);
     $mainDiv->addAttribute(TagLabels::HREF, URLBuilder::getCatalogLinkForTree($tree->key));
     /*} else {
           $span->addChild($mainDiv);
           $mainDiv->addStyleClasses(["f-17", "label"]);
       }*/
     $mainDiv->addChild($tree->value);
     return $span;
 }
開發者ID:gingerP,項目名稱:shop,代碼行數:18,代碼來源:BottomPanel.php

示例3: getDOMForSingleItemPageFromTree

 public static function getDOMForSingleItemPageFromTree($key)
 {
     $mainTag = new Div();
     $mainTag->addStyleClasses(["catalog_tree"]);
     $treeUtils = new TreeUtils();
     $mainTree = $treeUtils->buildTreeByLeafs();
     $path = $treeUtils->getTreePath($mainTree, $key);
     $data = [self::getArrayItemForDefaultLink()];
     for ($pathIndex = 1; $pathIndex < count($path); $pathIndex++) {
         $item = [];
         $trimText = Utils::trimStr($path[$pathIndex]->value, Constants::DEFAULT_TEXT_LENGTH_FOR_CATALOG_PATH_LINK);
         if ($pathIndex == count($path) - 1) {
             $pageNumber = Utils::getFromGET(UrlParameters::PAGE_NUM);
             $itemsCount = Utils::getFromGET(UrlParameters::ITEMS_COUNT);
             $item[0] = $trimText;
             $item[1] = URLBuilder::getSingleItemLinkBack($pageNumber, $itemsCount);
         } else {
             $item[0] = $trimText;
             $item[1] = URLBuilder::getCatalogLinkForTree($path[$pathIndex]->key);
         }
         array_push($data, $item);
     }
     $mainTag->addChildList(self::buildPathLink($data));
     return $mainTag;
 }
開發者ID:gingerP,項目名稱:shop,代碼行數:25,代碼來源:PathLinks.php


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