當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Brick類代碼示例

本文整理匯總了PHP中Brick的典型用法代碼示例。如果您正苦於以下問題:PHP Brick類的具體用法?PHP Brick怎麽用?PHP Brick使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了Brick類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的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


注:本文中的Brick類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。