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


PHP Div::addAttribute方法代码示例

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


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

示例1: createGeneralContent

 protected function createGeneralContent()
 {
     $mainTag = new Div();
     $mainTag->addAttribute("style", "margin: 1px 0px 0px 3px;");
     $items = new Items();
     $catalogLinks = new CatalogLinks();
     if (array_key_exists(UrlParameters::PAGE_NAME, $_GET)) {
         $pageNumber = Constants::DEFAULT_PAGE_NUMBER;
         $itemsCount = Labels::VIEW_MODE_NUMERIC_DEF;
         if (array_key_exists(UrlParameters::PAGE_NUM, $_GET)) {
             $pageNumber = Utils::getFromGET(UrlParameters::PAGE_NUM);
         }
         if (array_key_exists(UrlParameters::ITEMS_COUNT, $_GET)) {
             $itemsCount = Utils::getFromGET(UrlParameters::ITEMS_COUNT);
         }
         if (array_key_exists(UrlParameters::SEARCH_VALUE, $_GET)) {
             $itemsType = new CatalogLoader();
             $searchValue = Utils::getFromGET(UrlParameters::SEARCH_VALUE);
             $itemsType->getItemSearchData($pageNumber, $itemsCount, $searchValue);
             if ($itemsType->dataTotalCount == 0) {
                 return "";
             }
             $mainTag->addChild($catalogLinks->getPaginationLinks($pageNumber, $itemsCount, $itemsType->dataTotalCount, 'top'));
             $mainTag->addChild($items->getItemsTable($pageNumber, $itemsCount, $itemsType->data, '', $searchValue));
             $mainTag->addChild($catalogLinks->getPaginationLinks($pageNumber, $itemsCount, $itemsType->dataTotalCount, 'bottom'));
         } else {
             if (array_key_exists(UrlParameters::KEY, $_GET)) {
                 $itemsType = new CatalogLoader();
                 $keyValue = Utils::getFromGET(UrlParameters::KEY);
                 $itemsType->getItemsMenuData($pageNumber, $itemsCount, $keyValue);
                 $mainTag->addChild($catalogLinks->getPaginationLinks($pageNumber, $itemsCount, $itemsType->dataTotalCount, 'top'));
                 $mainTag->addChild($items->getItemsTable($pageNumber, $itemsCount, $itemsType->data, $keyValue, ''));
                 $mainTag->addChild($catalogLinks->getPaginationLinks($pageNumber, $itemsCount, $itemsType->dataTotalCount, 'bottom'));
             } else {
                 $itemsType = new CatalogLoader();
                 $itemsType->getItemsMainData($pageNumber, $itemsCount);
                 $mainTag->addChild($catalogLinks->getPaginationLinks($pageNumber, $itemsCount, $itemsType->dataTotalCount, 'top'));
                 $mainTag->addChild($items->getItemsTable($pageNumber, $itemsCount, $itemsType->data, '', ''));
                 $mainTag->addChild($catalogLinks->getPaginationLinks($pageNumber, $itemsCount, $itemsType->dataTotalCount, 'bottom'));
             }
         }
     }
     return $mainTag;
 }
开发者ID:gingerP,项目名称:shop,代码行数:44,代码来源:CatalogPage.php

示例2: getDOMForViewMode

 private static function getDOMForViewMode($type)
 {
     $mainDom = new Div();
     $mainDom->addStyleClass($type);
     $mainDom->addAttribute("view_type", $type);
     switch ($type) {
         case "compact":
             $mainDom->addChildList([new Div(), new Div(), new Div(), new Div(), new Div(), new Div()]);
             break;
         case "extend":
             $mainDom->addChildList([new Div(), new Div(), new Div()]);
             break;
         case "metro":
             $mainDom->addChildList([new Div(), new Div()]);
             break;
         default:
             $mainDom->addChildList([new Div(), new Div(), new Div(), new Div(), new Div(), new Div()]);
     }
     return $mainDom;
 }
开发者ID:gingerP,项目名称:shop,代码行数:20,代码来源:PathLinks.php

示例3: getPreviewImages

 private function getPreviewImages($images, $key, $display)
 {
     $mainTag = new Div();
     $mainTag->addStyleClasses(["default-skin"]);
     $viewPort = new Div();
     $viewPort->addStyleClass("viewport");
     $overviewImages = new Div();
     $overviewImages->addStyleClasses([$key, "overview"]);
     if (!$display) {
         $overviewImages->addAttribute("style", "display:none;");
     }
     foreach ($images as $image) {
         $imageContainer = new Div();
         $imageContainer->addStyleClasses(["blackout", "image_preview"]);
         $img = new Img();
         $img->addAttribute("src", $image);
         $overviewImages->addChild($imageContainer->addChild($img));
     }
     if (count($images) == 0) {
         $mainTag->addAttribute('style', 'display: none;');
     }
     return $mainTag->addChild($viewPort->addChild($overviewImages));
 }
开发者ID:gingerP,项目名称:shop,代码行数:23,代码来源:SingleItemPage.php

示例4: getCatalogItems

 private function getCatalogItems()
 {
     $dbGoods = new DBGoodsType();
     $catalogLoader = new CatalogLoader();
     $catalogLoader->getItemsMainData(1, 8);
     $goods = $dbGoods->extractDataFromResponse($catalogLoader->data, DB::TABLE_GOODS___MAPPER);
     $goodIndex = 0;
     $slideShowContainer = new Div();
     $slideShowContainer->addStyleClass("main_page_items_slideshow");
     $slideShow = new Div();
     $slideShow->addStyleClasses(["slide_show", "catalog_items"]);
     $div02 = new Div();
     $div02->addAttribute("style", "overflow: hidden;");
     while ($goodIndex < count($goods)) {
         $div02->addChild($this->renderGalleryItemWithSingleItem($goods[$goodIndex]));
         $goodIndex++;
     }
     $slideShowContainer->addChildren($slideShow->addChildren($div02));
     return [$this->getCatalogItemsTitle(), $slideShowContainer];
 }
开发者ID:gingerP,项目名称:shop,代码行数:20,代码来源:MainPage.php


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