本文整理汇总了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;
}
示例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;
}
示例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));
}
示例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];
}