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


PHP HtmlObject\Element类代码示例

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


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

示例1: getItemElement

 public function getItemElement()
 {
     $element = new Element('li');
     $link = new Link($this->link, $this->value, $this->attributes);
     $element->appendChild($link);
     return $element;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:7,代码来源:LinkItem.php

示例2: 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

示例3: content

 public static function content(ContentBlockController $controller)
 {
     $content = $controller->getSearchableContent();
     $dom = new HtmlDomParser();
     $r = $dom->str_get_html($content, true, true, DEFAULT_TARGET_CHARSET, false);
     if (is_object($r)) {
         foreach ($r->find('concrete-picture') as $picture) {
             $fID = $picture->fid;
             $fo = File::getByID($fID);
             if (is_object($fo)) {
                 $tag = new AmpImg($fo);
                 $tag->alt($picture->alt);
                 $picture->outertext = (string) $tag;
             }
         }
         foreach ($r->find('img') as $img) {
             $tag = new Element('amp-img');
             $tag->alt($img->alt);
             $tag->src($img->src);
             $tag->height($img->height);
             $tag->width($img->width);
             $img->outertext = (string) $tag;
         }
         foreach ($r->find('*[style]') as $element) {
             $element->removeAttribute('style');
         }
         $content = (string) $r->restore_noise($r);
     }
     $content = LinkAbstractor::translateFrom($content);
     return $content;
 }
开发者ID:hissy,项目名称:concrete5-amp,代码行数:31,代码来源:Converter.php

示例4: 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

示例5: 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

示例6: getColumnValue

 protected function getColumnValue()
 {
     $span = new Element('span');
     $link = new Element('a', t('XML Element'), array('href' => '#'));
     $tooltip = new Element('i', '', array('class' => 'launch-tooltip fa fa-question-circle', 'title' => t('Raw CIF XML Imported because this attribute is not installed or mapped to an existing attribute.')));
     $span->appendChild($link);
     $span->appendChild($tooltip);
     return $span;
 }
开发者ID:motoki1199,项目名称:addon_migration_tool,代码行数:9,代码来源:ImportedFormatter.php

示例7: 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

示例8: __toString

 /**
  * @return string
  */
 public function __toString()
 {
     $e = new Element('script');
     $e->type('text/javascript')->src($this->getAssetURL());
     if (!$this->conditional) {
         return (string) $e;
     } else {
         return sprintf('<!--[if %s]>%s<![endif]-->', $this->conditional, (string) $e);
     }
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:13,代码来源:JavascriptConditionalAsset.php

示例9: getItemElement

 public function getItemElement()
 {
     $element = new Element('li');
     $link = new Link('#', $this->getItemName());
     $link->setAttribute('data-tree-action', $this->getAction());
     $link->setAttribute('dialog-title', $this->getDialogTitle());
     $link->setAttribute('data-tree-action-url', $this->getActionURL());
     $element->appendChild($link);
     return $element;
 }
开发者ID:ppiedaderawnet,项目名称:concrete5,代码行数:10,代码来源:AbstractItem.php

示例10: 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

示例11: getLayoutContainerHtmlObject

 public function getLayoutContainerHtmlObject()
 {
     $gf = $this->layout->getThemeGridFrameworkObject();
     if (is_object($gf)) {
         $dom = new HtmlDomParser();
         $r = $dom->str_get_html($gf->getPageThemeGridFrameworkRowStartHTML() . $gf->getPageThemeGridFrameworkRowEndHTML());
         $nodes = $r->childNodes();
         $node = $nodes[0];
         $element = new Element($node->tag);
         $element->id($node->id);
         $element->class($node->class);
         return $element;
     }
 }
开发者ID:hdk0016,项目名称:concrete5-1,代码行数:14,代码来源:ThemeGridFormatter.php

示例12: testCanDynamicallyCreateObjects

 public function testCanDynamicallyCreateObjects()
 {
     $object = Element::p('foo')->class('bar');
     $matcher = $this->getMatcher();
     $matcher['attributes']['class'] = 'bar';
     $this->assertHTML($matcher, $object);
 }
开发者ID:Geekathon,项目名称:reddit-clone,代码行数:7,代码来源:ElementTest.php

示例13: getPresetContainerHtmlObject

 public function getPresetContainerHtmlObject()
 {
     $dom = new HtmlDomParser();
     $r = $dom->str_get_html($this->arrayPreset['container']);
     if (is_object($r)) {
         $nodes = $r->childNodes();
         $node = $nodes[0];
         if (is_object($node)) {
             $element = new Element($node->tag);
             $element->class($node->class);
         }
     }
     if (!isset($element)) {
         $element = new Element('div');
     }
     return $element;
 }
开发者ID:ceko,项目名称:concrete5-1,代码行数:17,代码来源:ThemeFormatter.php

示例14: testGetSelectOptions

 public function testGetSelectOptions()
 {
     $select = $this->former->select('foo')->options($this->options);
     foreach ($this->options as $key => $option) {
         $options[$key] = Element::create('option', $option, array('value' => $key));
     }
     $this->assertEquals($select->getOptions(), $options);
 }
开发者ID:aleguisf,项目名称:fvdev1,代码行数:8,代码来源:SelectTest.php

示例15: __construct

 /**
  * Build a new Media Object
  *
  * @param string $image   Image URL
  * @param string $title   Title
  * @param string $content Content
  */
 public function __construct($image, $title, $content)
 {
     $this->addClass('media');
     $image = Image::create($image);
     $figure = Element::figure($image)->class('media-object');
     $body = Element::div()->class('media-body');
     $title = Element::h2($title)->class('media-heading');
     $this->nest(array('figure' => $figure, 'body' => $body->nest(array('title' => $title, 'content' => $content))));
 }
开发者ID:Vrian7ipx,项目名称:repocas,代码行数:16,代码来源:MediaObject.php


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