• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Brick类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: play

 public static function play()
 {
     $play = new Brick('div');
     $play->addClass('play');
     $play->append('<img src="' . url('assets/oembed/oembed-play.png') . '" alt="Play">');
     return $play;
 }
开发者ID:muten84,项目名称:luigibifulco.it,代码行数:7,代码来源:template.php


示例2: headline

 public function headline()
 {
     if (!$this->readonly) {
         /*  $fieldName = $this->name;
               $blueprint = $this->page()->blueprint();
         	$fieldsets = $blueprint->fields($this)->$fieldName->fieldsets;*/
         $fieldsets = $this->fieldsets();
         $add = new Brick('a');
         $add->html('<i class="icon icon-left fa fa-chevron-circle-down"></i>' . l('fields.structure.add'));
         $add->addClass('structure-add-button label-option');
         $add->data('modal', true);
         $dropDown = new Brick("div");
         $dropDown->addClass('builder-drop-down');
         $addList = new Brick('ul');
         $addList->addClass('builder-add-list');
         foreach ($fieldsets as $fieldsetName => $fieldsetFields) {
             $addListItem = new Brick('li');
             $addListItemLink = new Brick('a');
             $addListItemLink->html('<i class="icon icon-left fa fa-plus-circle"></i>' . $fieldsetFields['label']);
             $addListItemLink->addClass('builder-add-button');
             $addListItemLink->data('modal', true);
             $addListItemLink->attr('href', purl($this->page, 'field/' . $this->name . '/builder/add?fieldset=' . $fieldsetName));
             $addListItem->append($addListItemLink);
             $addList->append($addListItem);
         }
         $dropDown->append($addList);
     } else {
         $addList = null;
         $add = null;
     }
     $label = BaseField::label();
     $label->append($add);
     $label->append($dropDown);
     return $label;
 }
开发者ID:cnoss,项目名称:fubix,代码行数:35,代码来源:builder.php


示例3: template

 protected function template($class = false)
 {
     $output = new Brick('div');
     $output->addClass('oembed');
     if ($class !== false) {
         $output->addClass($class);
     } else {
         $output->addClass('oembed-' . substr(md5($this->url), 0, 6));
     }
     if ($this->media->get('type') === 'video') {
         $output = OembedTemplate::ratio($output, $this->media);
         if (c::get('oembed.lazyvideo', false)) {
             $output->addClass('oembed-lazyvideo');
         }
         $play = OembedTemplate::play();
         $output->append($play);
         $thumb = OembedTemplate::thumb($this->thumb->get($this->media()));
         $output->append($thumb);
         $html = OembedTemplate::embed($this->media, $this->autoplay);
     } else {
         $html = $this->media->get('html');
     }
     $html = OembedTemplate::validation($html);
     $output->append($html);
     return $output;
 }
开发者ID:muten84,项目名称:luigibifulco.it,代码行数:26,代码来源:oembed.php


示例4: content

 public function content()
 {
     $html = '<ul class="input-list field-grid cf">';
     switch ($this->columns()) {
         case 2:
             $width = ' field-grid-item-1-2';
             break;
         case 3:
             $width = ' field-grid-item-1-3';
             break;
         case 4:
             $width = ' field-grid-item-1-4';
             break;
         case 5:
             $width = ' field-grid-item-1-5';
             break;
         default:
             $width = '';
             break;
     }
     foreach ($this->options() as $key => $value) {
         $html .= '<li class="input-list-item field-grid-item' . $width . '">';
         $html .= $this->item($key, $value);
         $html .= '</li>';
     }
     $html .= '</ul>';
     $content = new Brick('div');
     $content->addClass('field-content');
     $content->append($html);
     return $content;
 }
开发者ID:irenehilber,项目名称:kirby-base,代码行数:31,代码来源:inputlist.php


示例5: icon

 public function icon()
 {
     $icon = new Brick('div');
     $icon->addClass('field-icon');
     $icon->append('<span>.' . $this->extension . '</span>');
     return $icon;
 }
开发者ID:irenehilber,项目名称:kirby-base,代码行数:7,代码来源:filename.php


示例6: time

 public static function time($timestamp, $format = 'short', $classes = '')
 {
     $brick = new Brick('time');
     $brick->datetime = Date::format($timestamp, 'iso');
     $brick->text(Date::format($timestamp, $format));
     $brick->addClass($classes);
     return $brick;
 }
开发者ID:papplo,项目名称:kirby-plugins,代码行数:8,代码来源:html5.php


示例7: template

 public function template()
 {
     $wrapper = new Brick('div', null);
     $wrapper->data('tab-name', $this->i18n($this->label));
     $wrapper->data('field', 'tabs');
     $wrapper->addClass('tab-placeholder');
     return $wrapper;
 }
开发者ID:Jayshua,项目名称:Kirby-Tabs-Field,代码行数:8,代码来源:tabs.php


示例8: element

 public function element()
 {
     $element = parent::element();
     $script = new Brick('script', false);
     $script->append('previewImagesFromSidebar()');
     $element->append($script);
     return $element;
 }
开发者ID:jimhare,项目名称:Kirby-PreviewSidebarImages-Field,代码行数:8,代码来源:previewImagesFromSidebar.php


示例9: content

 public function content()
 {
     $content = new Brick('div');
     $content->addClass('field-content');
     $content->append($this->input());
     $content->append($this->icon());
     return $content;
 }
开发者ID:idrisyangui,项目名称:kirby-field-repeater,代码行数:8,代码来源:repeater.php


示例10: displayEditBox

 public function displayEditBox($sType, Brick $oBrick, $bIsUpload = false)
 {
     $this->_sContentTemplate = 'edit.' . $sType;
     $this->_addTemplateVar('bListManager', $oBrick->isInAList());
     $this->_addTemplateVar('bHistoryManager', true);
     $this->_addTemplateVar('sFormAction', '/admin/save.' . $sType . '.html');
     $this->_addTemplateVar('bIsUpload', $bIsUpload);
     $this->_addTemplateVar('sModalType', $sType . '.edit');
     $this->_addTemplateVar('brick', $oBrick);
     $this->_render();
 }
开发者ID:posib,项目名称:posib-legacy,代码行数:11,代码来源:modals.php


示例11: headline

 public function headline()
 {
     $add = new Brick('a');
     $add->html('<i class="icon icon-left fa fa-plus-circle"></i>' . l('fields.structure.add'));
     $add->addClass('structure-add-button label-option');
     $add->attr('#');
     $label = parent::label();
     $label->addClass('structure-label');
     $label->append($add);
     return $label;
 }
开发者ID:muten84,项目名称:luigibifulco.it,代码行数:11,代码来源:structure.php


示例12: preview

 public function preview()
 {
     $figure = new Brick('figure');
     if ($image = $this->image()) {
         $figure->attr('style', 'background-image: url(' . $image->crop(75)->url() . ')');
         $url = $image->url('edit');
     } else {
         $figure->attr('style', 'background-image: url(' . $this->value() . ')');
         $url = '';
     }
     return '<a href="' . $url . '" class="input-preview">' . $figure . '</a>';
 }
开发者ID:nsteiner,项目名称:kdoc,代码行数:12,代码来源:image.php


示例13: input

 public function input()
 {
     $input = new Brick('input', null);
     $input->addClass('tabfield');
     $input->attr(array('id' => $this->id(), 'name' => $this->name(), 'required' => $this->required(), 'autofocus' => $this->autofocus(), 'autocomplete' => $this->autocomplete(), 'readonly' => $this->readonly(), 'type' => 'checkbox', 'checked' => v::accepted($this->value())));
     $wrapper = parent::input();
     $wrapper->tag('label');
     $wrapper->text($this->i18n($this->text()));
     $wrapper->attr('for', $this->id());
     $wrapper->removeAttr('id');
     $wrapper->addClass('tabfield');
     $wrapper->prepend($input);
     return $wrapper;
 }
开发者ID:mungle,项目名称:Kirby-Tabs-Field,代码行数:14,代码来源:tabs.php


示例14: content

 /**
  * Generate field content markup
  *
  * @return string
  */
 public function content()
 {
     $wrapper = new Brick('div');
     $wrapper->addClass('subpagelist');
     $children = $this->subpages();
     // add pagination to the subpages
     $limit = $this->limit() ? $this->limit() : 10000;
     $children = $children->paginate($limit, array('page' => get('page')));
     // use existing snippet to build the list
     // @see panel/app/controllers/views/pages.php
     $subpages = new Snippet('pages/sidebar/subpages', array('title' => l('pages.show.subpages.title'), 'page' => $this->page(), 'subpages' => $children, 'addbutton' => !api::maxPages($this, $this->subpages()->max()), 'pagination' => $children->pagination()));
     // use template with defined vars
     $wrapper->html(tpl::load(__DIR__ . DS . 'template.php', array('subpages' => $subpages)));
     return $wrapper;
 }
开发者ID:jenniferhail,项目名称:kirbypine,代码行数:20,代码来源:subpagelist.php


示例15: headline

 public function headline()
 {
     if (!$this->readonly) {
         $add = new Brick('a');
         $add->html('<i class="icon icon-left fa fa-plus-circle"></i>' . l('fields.structure.add'));
         $add->addClass('structure-add-button label-option');
         $add->data('modal', true);
         $add->attr('href', purl($this->model, 'field/' . $this->name . '/structure/add'));
     } else {
         $add = null;
     }
     $label = parent::label();
     $label->addClass('structure-label');
     $label->append($add);
     return $label;
 }
开发者ID:irenehilber,项目名称:kirby-base,代码行数:16,代码来源:structure.php


示例16: content

 /**
  * Generate field content markup
  *
  * @return string
  */
 public function content()
 {
     $wrapper = new Brick('div');
     $wrapper->addClass('subpagelist');
     $children = $this->subpages();
     // add pagination to the subpages
     $limit = $this->limit() ? $this->limit() : 10000;
     $children = $children->paginated('sidebar');
     $pagination = new Snippet('pagination', array('pagination' => $children->pagination(), 'nextUrl' => $children->pagination()->nextPageUrl(), 'prevUrl' => $children->pagination()->prevPageUrl()));
     // use existing snippet to build the list
     // @see /panel/app/src/panel/models/page/sidebar.php
     $subpages = new Snippet('pages/sidebar/subpages', array('title' => $this->i18n($this->label), 'page' => $this->page(), 'subpages' => $children, 'addbutton' => $this->page->addButton(), 'pagination' => $pagination));
     // use template with defined vars
     $wrapper->html(tpl::load(__DIR__ . DS . 'template.php', array('subpages' => $subpages)));
     return $wrapper;
 }
开发者ID:yikuo,项目名称:stb2b,代码行数:21,代码来源:subpagelist.php


示例17: input

 public function input()
 {
     $color = new Brick('input');
     $color->addClass('colorpicker');
     if ($this->value() == "" && $this->default() !== "") {
         $value = $this->default();
     } elseif ($this->value() == "" && $this->default() == "") {
         $value = "";
     } else {
         $value = $this->value();
     }
     $color->attr(array('name' => $this->name(), 'id' => $this->id(), 'type' => "text", 'data-defaultvalue' => $value, 'value' => $value));
     $color->append($this->option('', '', $this->value() == ''));
     $wrapper = new Brick('div');
     $wrapper->addClass('input color-wrapper');
     $wrapper->append($color);
     return $color;
 }
开发者ID:laurelschwulst,项目名称:spring2016.veryinteractive.net,代码行数:18,代码来源:color.php


示例18: content

 public function content()
 {
     $relation = new Brick('div');
     $relation->addClass('input input-display');
     if ($this->readonly()) {
         $relation->addClass('input-is-readonly');
     }
     $relation->data(array('field' => 'relation', 'search' => $this->search ? 1 : 0, 'readonly' => ($this->readonly or $this->disabled) ? 1 : 0));
     $relation->append('<div class="placeholder">&nbsp;</div>');
     $content = new Brick('div');
     $content->addClass('field-content input-with-relationbox');
     $content->append($relation);
     // list with options
     $html = '<div class="input-list">';
     if ($this->search) {
         $html .= '<input class="relationbox-search" placeholder="Type to filter options">';
     }
     $html .= '<ul>';
     foreach ($this->options() as $key => $value) {
         $html .= '<li class="input-list-item">';
         $html .= $this->item($key, $value);
         $html .= '</li>';
     }
     $html .= '</ul>';
     $html .= '</div>';
     $content->append($html);
     $content->append($this->icon());
     return $content;
 }
开发者ID:Ventricule,项目名称:atlas-sensible,代码行数:29,代码来源:relation.php


示例19: input

 public function input()
 {
     $select = new Brick('select');
     $select->addClass('selectbox');
     $select->attr(array('name' => $this->name(), 'id' => $this->id(), 'required' => $this->required(), 'autocomplete' => $this->autocomplete(), 'autofocus' => $this->autofocus(), 'readonly' => $this->readonly(), 'disabled' => $this->disabled()));
     $id = $this->id();
     $select->append($this->option('', '', $this->value() == ''));
     if ($this->readonly()) {
         $select->attr('tabindex', '-1');
     }
     foreach ($this->options() as $value => $text) {
         $select->append($this->option($value, $text, $this->value() == $value));
     }
     $inner = new Brick('div');
     $inner->addClass('selectbox-wrapper');
     $inner->append($select);
     $wrapper = new Brick('div');
     $wrapper->addClass('input input-with-selectbox');
     $wrapper->append($inner);
     if ($this->readonly()) {
         $wrapper->addClass('input-is-readonly');
     } else {
         $wrapper->attr('data-focus', 'true');
     }
     echo "<script>console.log('layout " . $id . "');</script>";
     echo "<script>buildLayout(" . $id . ");</script>";
     return $wrapper;
 }
开发者ID:yikuo,项目名称:stb2b,代码行数:28,代码来源:layout.php


示例20: input

 public function input()
 {
     $select = new Brick('select');
     $select->addClass('selectbox');
     $select->attr(array('name' => $this->name(), 'id' => $this->id(), 'required' => $this->required(), 'autocomplete' => $this->autocomplete(), 'autofocus' => $this->autofocus(), 'readonly' => $this->readonly(), 'disabled' => $this->disabled()));
     $default = $this->default();
     if (!$this->required() or empty($default)) {
         $select->append($this->option('', '', $this->value() == ''));
     }
     if ($this->readonly()) {
         $select->attr('tabindex', '-1');
     }
     foreach ($this->options() as $value => $text) {
         $select->append($this->option($value, $text, $this->value() == $value));
     }
     $inner = new Brick('div');
     $inner->addClass('selectbox-wrapper');
     $inner->append($select);
     $wrapper = new Brick('div');
     $wrapper->addClass('input input-with-selectbox');
     $wrapper->append($inner);
     if ($this->readonly()) {
         $wrapper->addClass('input-is-readonly');
     } else {
         $wrapper->attr('data-focus', 'true');
     }
     return $wrapper;
 }
开发者ID:LucasFyl,项目名称:korakia,代码行数:28,代码来源:select.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP Browse类代码示例发布时间:2022-05-23
下一篇:
PHP Breadcrumbs类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap