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


PHP Brick::attr方法代碼示例

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


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

示例1: input

 public function input()
 {
     $input = new Brick('input');
     $input->addClass('input');
     $input->attr(array('type' => $this->type(), 'value' => html($this->value(), false), '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()));
     if ($this->readonly()) {
         $input->attr('tabindex', '-1');
         $input->addClass('input-is-readonly');
     }
     return $input;
 }
開發者ID:kompuser,項目名稱:panel,代碼行數:11,代碼來源:input.php

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

示例3: thumb

 public static function thumb($thumbnail)
 {
     $thumb = new Brick('div');
     $thumb->addClass('thumb');
     $thumb->attr('style', 'background-image: url(' . $thumbnail . ')');
     return $thumb;
 }
開發者ID:muten84,項目名稱:luigibifulco.it,代碼行數:7,代碼來源:template.php

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

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

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

示例7: item

 public function item($value, $text)
 {
     $input = $this->input($value);
     $label = new Brick('label', $this->i18n($text));
     $label->addClass('input');
     $label->attr('data-focus', 'true');
     $label->prepend($input);
     return $label;
 }
開發者ID:muten84,項目名稱:luigibifulco.it,代碼行數:9,代碼來源:inputlist.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: mapsearch

 public function mapsearch()
 {
     $mapsearch = new Brick('div');
     $mapsearch->addClass('mapsearch');
     // Search field
     $input = new Brick("input");
     $input->attr("id", "geo-search-field");
     $input->attr("placeholder", "Zoek naar locatie");
     $input->addClass("input mapsearch-field");
     // Search button
     $button = new Brick("input");
     $button->attr("id", "geo-search-submit");
     $button->attr("type", "button");
     $button->attr("value", "Zoek");
     $button->addClass("btn btn-rounded mapsearch-button");
     $mapsearch->append($input);
     $mapsearch->append($button);
     return $mapsearch;
 }
開發者ID:junglesta,項目名稱:freezer,代碼行數:19,代碼來源:geolocation.php

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

示例11: label

 public function label()
 {
     if (!$this->label) {
         return null;
     }
     $label = new Brick('label', $this->i18n($this->label));
     $label->addClass('label');
     $label->attr('for', $this->id());
     if ($this->required()) {
         $label->append(new Brick('abbr', '*', array('title' => l::get('required', 'Required'))));
     }
     return $label;
 }
開發者ID:nsteiner,項目名稱:kdoc,代碼行數:13,代碼來源:base.php

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

示例13: item

 public function item($value, $text)
 {
     $input = $this->input($value);
     $label = new Brick('label');
     $label->addClass('input');
     $label->attr('data-focus', 'true');
     $text = new Brick('span', $this->i18n($text));
     $label->prepend($text);
     $label->prepend($input);
     if ($this->readonly) {
         $label->addClass('input-is-readonly');
     }
     return $label;
 }
開發者ID:Ventricule,項目名稱:atlas-sensible,代碼行數:14,代碼來源:relation.php

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

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


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