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


PHP Element::addClass方法代码示例

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


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

示例1: getMenuItemLinkElement

 public function getMenuItemLinkElement()
 {
     $a = new Link();
     $a->setValue('');
     if ($this->menuItem->getIcon()) {
         $icon = new Element('i');
         $icon->addClass('fa fa-' . $this->menuItem->getIcon());
         $a->appendChild($icon);
     }
     if ($this->menuItem->getLink()) {
         $a->href($this->menuItem->getLink());
     }
     foreach ($this->menuItem->getLinkAttributes() as $key => $value) {
         $a->setAttribute($key, $value);
     }
     // Set styling for accessiblity options
     if (Config::get('concrete.accessibility.toolbar_large_font')) {
         $spacing = 'padding-top: 15px';
         $height = 'line-height:17px;';
     } else {
         $spacing = 'padding: 16px 5px;';
         $height = 'line-height:14px;';
     }
     $wbTitle = new Element('div');
     $wbTitle->style($height . $spacing);
     $wbTitle->addClass('wb-fourms')->setValue($this->menuItem->getLabel());
     $a->appendChild($wbTitle);
     return $a;
 }
开发者ID:katzueno,项目名称:forums,代码行数:29,代码来源:controller.php

示例2: getColumnHtmlObjectEditMode

 public function getColumnHtmlObjectEditMode()
 {
     $column = $this->getColumnHtmlObject();
     $inner = new Element('div');
     $inner->addClass('ccm-layout-column-inner ccm-layout-column-highlight');
     $column->appendChild($inner);
     return $column;
 }
开发者ID:digideskio,项目名称:concrete5,代码行数:8,代码来源:Column.php

示例3: getListIconElement

 public function getListIconElement()
 {
     $env = \Environment::get();
     $type = $this->controller->getAttributeType();
     $url = $env->getURL(implode('/', array(DIRNAME_ATTRIBUTES . '/' . $type->getAttributeTypeHandle() . '/' . FILENAME_BLOCK_ICON)), $type->getPackageHandle());
     $img = new Element('img');
     $img->addClass('ccm-attribute-icon')->src($url)->width(16)->height(16);
     return $img;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:9,代码来源:FileIconFormatter.php

示例4: view

 /**
  * Render element view with data.
  *
  * @param $data
  * @return string
  */
 public function view($data)
 {
     if (array_key_exists('current', $data)) {
         $this->current = $data['current'];
     }
     if (array_key_exists('title_formatter', $data)) {
         $tf = $data['title_formatter'];
     }
     if (array_key_exists('descr_formatter', $data)) {
         $df = $data['descr_formatter'];
     }
     $i = 1;
     foreach ($this->steps as $step) {
         $sdiv = new Element('div');
         $sstyle = $this->getStyle('step');
         if ($i == $this->current) {
             $sdiv->addClass($this->getClass('current'));
             $sstyle .= $this->getStyle('current');
         } elseif ($i < $this->current) {
             $sdiv->addClass($this->getClass('completed'));
             $sstyle .= $this->getStyle('completed');
         }
         $sdiv->addClass($this->getClass('step'))->setAttribute('style', $sstyle);
         $title = array_key_exists('title', $step) ? $step['title'] : '';
         $descr = array_key_exists('descr', $step) ? $step['descr'] : '';
         if (isset($tf) && is_callable($tf)) {
             $title = $tf($title);
         }
         if (isset($df) && is_callable($df)) {
             $descr = $df($descr);
         }
         $contdiv = new Element('div');
         $contdiv->addClass($this->getClass('content'))->setAttribute('style', $this->getStyle('content'));
         $tdiv = new Element('div', new Text($title));
         $tdiv->addClass($this->getClass('title'))->setAttribute('style', $this->getStyle('title'));
         $ddiv = new Element('div', new Text($descr));
         $ddiv->addClass($this->getClass('descr'))->setAttribute('style', $this->getStyle('descr'));
         $contdiv->appendChild($tdiv)->appendChild($ddiv);
         $sdiv->appendChild($contdiv);
         $this->appendChild($sdiv);
         $i++;
     }
     return $this->render();
 }
开发者ID:wwtg99,项目名称:html_component,代码行数:50,代码来源:StepView.php

示例5: getColumnElement

 protected function getColumnElement($contents)
 {
     $element = new Element('div');
     $element->addClass($this->getAreaLayoutColumnClass())->id('ccm-layout-column-' . $this->arLayoutColumnID);
     $inner = new Element('div');
     $inner->addClass('ccm-layout-column-inner');
     $inner->setValue($contents);
     $element->appendChild($inner);
     return $element;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:10,代码来源:CustomColumn.php

示例6: getColumnHtmlObjectEditMode

 public function getColumnHtmlObjectEditMode()
 {
     $column = $this->getPresetColumnObject();
     if ($column) {
         $html = $column->getColumnHtmlObject();
         $inner = new Element('div');
         $inner->addClass('ccm-layout-column-inner ccm-layout-column-highlight');
         $inner->setValue($this->getContents(true));
         $html->appendChild($inner);
         return $html;
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:12,代码来源:PresetColumn.php

示例7: getLabel

 /**
  * Prints out the current label
  *
  * @param  string $field The field to create a label for
  *
  * @return string        A <label> tag
  */
 protected function getLabel($field = null)
 {
     // Don't create a label if none exist
     if (!$field or !$this->label) {
         return null;
     }
     // Wrap label in framework classes
     $this->label->addClass($this->app['former.framework']->getLabelClasses());
     $this->label = $this->app['former.framework']->createLabelOf($field, $this->label);
     $this->label = $this->app['former.framework']->wrapLabel($this->label);
     return $this->label;
 }
开发者ID:autocar,项目名称:former,代码行数:19,代码来源:Group.php

示例8: getMenuElement

 public function getMenuElement()
 {
     if ($this->items->count() > $this->minItemThreshold) {
         $menu = new Element('div', null, $this->menuAttributes);
         $menu->addClass('popover')->addClass('fade');
         $menu->appendChild((new Element('div'))->addClass('arrow'));
         $inner = (new Element('div'))->addClass('popover-inner');
         $list = (new Element('ul'))->addClass('dropdown-menu');
         /**
          * @var $item ItemInterface
          */
         foreach ($this->items as $item) {
             $list->appendChild($item->getItemElement());
         }
         $inner->appendChild($list);
         $menu->appendChild($inner);
         return $menu;
     }
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:19,代码来源:AbstractMenu.php

示例9: getMenuItemLinkElement

 public function getMenuItemLinkElement()
 {
     $a = new Link();
     $a->setValue('');
     if ($this->menuItem->getIcon()) {
         $icon = new Element('i');
         $icon->addClass('fa fa-' . $this->menuItem->getIcon());
         $a->appendChild($icon);
     }
     if ($this->menuItem->getLink()) {
         $a->href($this->menuItem->getLink());
     }
     foreach ($this->menuItem->getLinkAttributes() as $key => $value) {
         $a->setAttribute($key, $value);
     }
     $label = new Element('span');
     $label->addClass('ccm-toolbar-accessibility-title')->setValue($this->menuItem->getLabel());
     $a->appendChild($label);
     return $a;
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:20,代码来源:Controller.php

示例10: getMenuItemLinkElement

 public function getMenuItemLinkElement()
 {
     $link = new Link('#', '');
     $link->setAttribute('data-panel-url', \URL::to('/ccm/system/panels/page/relations'));
     $link->setAttribute('title', t('View related pages'));
     $link->setAttribute('data-launch-panel', 'page_relations');
     if (is_object($this->multilingualSection)) {
         $icon = $this->flagService->getFlagIcon($this->multilingualSection->getIcon());
         $accessibility = new Element('span', $this->multilingualSection->getLanguageText());
         $accessibility->addClass('ccm-toolbar-accessibility-title');
         $link->appendChild($icon);
         $link->appendChild($accessibility);
     } else {
         $icon = new Element('i', '');
         $icon->addClass('fa fa-sitemap');
         $accessibility = new Element('span', t('Related Pages'));
         $accessibility->addClass('ccm-toolbar-accessibility-title');
         $link->appendChild($icon);
         $link->appendChild($accessibility);
     }
     return $link;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:22,代码来源:RelationListController.php

示例11: getLayoutContainerHtmlObject

 public function getLayoutContainerHtmlObject()
 {
     $element = new Element('div');
     $element->addClass('ccm-layout-column-wrapper')->id('ccm-layout-column-wrapper-' . $this->layout->getAreaLayoutID());
     return $element;
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:6,代码来源:CustomFormatter.php

示例12: getRequestIconElement

 public function getRequestIconElement()
 {
     if (!$this->isNewPageRequest()) {
         return parent::getRequestIconElement();
     }
     $span = new Element('i');
     $span->addClass('fa fa-file');
     return $span;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:9,代码来源:ApprovePageRequest.php

示例13: renderIcon

 public function renderIcon()
 {
     $element = new Element('i');
     $element->addClass($this->getIconClass());
     return $element;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:6,代码来源:StandardListView.php

示例14: getColumnElement

 protected function getColumnElement($contents)
 {
     $element = new Element('div');
     $element->addClass($this->getAreaLayoutColumnClass());
     $gf = $this->arLayout->getThemeGridFrameworkObject();
     if ($gf->hasPageThemeGridFrameworkOffsetClasses() && $this->getAreaLayoutColumnOffset()) {
         $element->addClass($this->getAreaLayoutColumnOffsetClass());
     }
     $element->setValue($contents);
     if ($this->getAreaLayoutColumnOffset() > 0 && !$gf->hasPageThemeGridFrameworkOffsetClasses()) {
         $collection = new Collection();
         $offset = new Element('div');
         $offset->addClass($this->getAreaLayoutColumnOffsetClass())->addClass('ccm-theme-grid-offset-column');
         $collection[0] = $offset;
         $collection[1] = $element;
         return $collection;
     } else {
         return $element;
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:20,代码来源:ThemeGridColumn.php

示例15: getListIconElement

 public function getListIconElement()
 {
     $span = new Element('i');
     $span->addClass('ccm-attribute-icon fa fa-' . $this->icon);
     return $span;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:6,代码来源:FontAwesomeIconFormatter.php


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