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


PHP Brick::data方法代码示例

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


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

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

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

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

示例4: counter

 public function counter()
 {
     if (!$this->minLength() && !$this->maxLength() || $this->readonly()) {
         return null;
     }
     $counter = new Brick('div');
     $counter->addClass('field-counter marginalia text');
     $length = str::length(trim($this->value()));
     if ($this->outsideRange($length)) {
         $counter->addClass('outside-range');
     }
     $counter->data('field', 'counter');
     $counter->html($length . ($this->maxLength() ? '/' . $this->maxLength() : ''));
     return $counter;
 }
开发者ID:nsteiner,项目名称:kdoc,代码行数:15,代码来源:text.php

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

示例6: content

 public function content()
 {
     $multiselect = new Brick('div');
     $multiselect->addClass('input input-display');
     if ($this->readonly()) {
         $multiselect->addClass('input-is-readonly');
     }
     $multiselect->attr(array('tabindex' => 0));
     $multiselect->data(array('field' => 'multiselect', 'search' => $this->search ? 1 : 0, 'readonly' => ($this->readonly or $this->disabled) ? 1 : 0));
     $multiselect->append('<div class="placeholder">&nbsp;</div>');
     $content = new Brick('div');
     $content->addClass('field-content input-with-multiselectbox');
     $content->append($multiselect);
     $content->append($this->optionlist());
     $content->append($this->icon());
     return $content;
 }
开发者ID:aguynamedirvin,项目名称:F-C,代码行数:17,代码来源:multiselect.php

示例7: input

 public function input()
 {
     $color = new Brick('input');
     $color->addClass('colorpicker');
     $color->data('field', 'minicolors');
     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:waagsociety,项目名称:fablab-website,代码行数:19,代码来源:color.php

示例8: input

 public function input()
 {
     $input = new Brick('input', null);
     $input->addClass('input');
     $input->attr(array('type' => $this->type(), 'value' => '', 'required' => $this->required(), 'name' => $this->name(), 'autocomplete' => $this->autocomplete() === false ? 'off' : 'on', 'autofocus' => $this->autofocus(), 'placeholder' => $this->i18n($this->placeholder()), 'readonly' => $this->readonly(), 'disabled' => $this->disabled(), 'id' => $this->id()));
     $input->tag('textarea');
     $input->removeAttr('type');
     $input->removeAttr('value');
     $input->data('field', 'editor');
     $input->html('{{yamlvalues}}' ?: false);
     if (!is_array($this->value())) {
         $input->val('{{yamlvalues}}');
     }
     if ($this->readonly()) {
         $input->attr('tabindex', '-1');
         $input->addClass('input-is-readonly');
     }
     return $input;
 }
开发者ID:idrisyangui,项目名称:kirby-field-repeater,代码行数:19,代码来源:repeater.php

示例9: editor

 /**
  * Create editor element
  *
  * This creates our main editor <div>.
  *
  * @since 1.0.0
  *
  * @return \Brick
  */
 protected function editor()
 {
     /*
        Prepare editor element
     */
     $editor = new Brick('div');
     $editor->addClass('input');
     $editor->addClass('wysiwyg-editor');
     $editor->attr('id', $this->id() . '-editor');
     $editor->data(array('storage' => $this->id(), 'buttons' => implode(',', $this->buttons), 'double-returns' => $this->doubleReturns, 'dragdrop-medium' => $this->mediumDragDrop));
     /*
        Parse markdown and set editor content
     */
     $editor->html($this->convertToHtml($this->value() ?: ''));
     return $editor;
 }
开发者ID:aoimedia,项目名称:kirby-wysiwyg,代码行数:25,代码来源:wysiwyg.php

示例10: content

 /**
  * Generate field content markup
  *
  * @since 1.0.0
  *
  * @return string
  */
 public function content()
 {
     $wrapper = new Brick('div');
     $wrapper->addClass('selector');
     $wrapper->data(array('field' => 'selector', 'name' => $this->name(), 'page' => $this->page(), 'mode' => $this->mode, 'autoselect' => $this->autoselect()));
     $wrapper->html(tpl::load(__DIR__ . DS . 'template.php', array('field' => $this)));
     return $wrapper;
 }
开发者ID:starckio,项目名称:Userskit,代码行数:15,代码来源:selector.php

示例11: deleteLink

 /**
  * Get a link that allows to delete the comment. Only available to registered
  * users.
  *
  * @return  Brick|string
  */
 public function deleteLink()
 {
     // Ensure the current user is allowed to edit the comment
     if (!$this->exists || !$this->currentUserCan('delete')) {
         return '';
     }
     $uri = $this->page()->uri();
     $hash = $this->page()->hash();
     $id = $this->id();
     $link = new Brick('a');
     $link->attr('href', $this->actionUrl('delete'));
     $link->data('href', $this->actionUrl('delete', true));
     $link->addClass('comment-delete-link js-delete');
     $link->text(l('comments.comment.delete', 'Delete'));
     return $link;
 }
开发者ID:buditanrim,项目名称:kirby-comments,代码行数:22,代码来源:comment.php

示例12: map

 public function map()
 {
     # Wrapper
     $map_content = new Brick('div');
     $map_content->addClass('field-content field-google-map-ui');
     $map_content->data($this->center);
     return $map_content;
 }
开发者ID:aguynamedirvin,项目名称:F-C,代码行数:8,代码来源:place.php

示例13: input

 /**
  * Create input element.
  *
  * @since 1.0.0
  *
  * @return Brick
  */
 public function input()
 {
     $input = new Brick('input');
     /* Set general attributes */
     $input->attr(array('type' => 'text', 'name' => $this->name(), 'id' => $this->id(), 'value' => $this->value(), 'required' => $this->required(), 'autocomplete' => 'off', 'tabindex' => '-1', 'disabled' => $this->option('disabled'), 'readonly' => $this->option('readonly')));
     $input->addClass('input-is-readonly');
     /* Set data attributes */
     $input->data(array('field' => 'rangesliderfield', 'min' => $this->option('min'), 'max' => $this->option('max'), 'step' => $this->option('step'), 'prefix' => $this->option('prefix'), 'postfix' => $this->option('postfix')));
     return $input;
 }
开发者ID:JonasDoebertin,项目名称:kirby-range-slider,代码行数:17,代码来源:rangeslider.php

示例14: content

 /**
  * Generate field content markup
  *
  * @since 1.0.0
  *
  * @return string
  */
 public function content()
 {
     /* Zusätzliche Textspalten */
     $additional_columns = yaml($this->page()->columns());
     $additional_columns = reset($additional_columns);
     /* Bildbeschnitt, falls vorhanden */
     $image_crop = $this->page()->image_crop() != "" ? $this->page()->image_crop() : "";
     $wrapper = new Brick('div');
     $wrapper->addClass('layoutswitcher');
     $wrapper->data(array('field' => 'layoutswitcher', 'name' => $this->name(), 'page' => $this->page()));
     $wrapper->html(tpl::load(__DIR__ . DS . 'template.php', array('field' => $this, 'text1' => $this->page()->text(), 'text2' => $additional_columns["text2"], 'text3' => $additional_columns["text3"], 'noc' => intval($additional_columns["noc"]), 'crop' => $image_crop, 'page_tpl' => $this->page()->intendedTemplate())));
     return $wrapper;
 }
开发者ID:cnoss,项目名称:fubix,代码行数:20,代码来源:layoutswitchersingleton.php

示例15: headline

 public function headline()
 {
     // get entries
     $entries = $this->entries();
     // check if limit is either null or the number of entries less than limit
     if (!$this->readonly && (is_null($this->limit) || is_int($this->limit) && $entries->count() < $this->limit)) {
         $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;
     }
     // make sure there's at least an empty label
     if (!$this->label) {
         $this->label = '&nbsp;';
     }
     $label = parent::label();
     $label->addClass('structure-label');
     $label->append($add);
     return $label;
 }
开发者ID:nsteiner,项目名称:kdoc,代码行数:23,代码来源:structure.php


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