本文整理汇总了PHP中Brick::append方法的典型用法代码示例。如果您正苦于以下问题:PHP Brick::append方法的具体用法?PHP Brick::append怎么用?PHP Brick::append使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Brick
的用法示例。
在下文中一共展示了Brick::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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"> </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;
}
示例2: content
public function content()
{
$content = new Brick('div');
$content->addClass('field-content');
$content->append($this->input());
$content->append($this->icon());
return $content;
}
示例3: 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;
}
示例4: 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;
}
示例5: icon
public function icon()
{
$icon = new Brick('div');
$icon->addClass('field-icon');
$icon->append('<span>.' . $this->extension . '</span>');
return $icon;
}
示例6: 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;
}
示例7: 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;
}
示例8: 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;
}
示例9: 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"> </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;
}
示例10: element
public function element()
{
$element = parent::element();
$script = new Brick('script', false);
$script->append('previewImagesFromSidebar()');
$element->append($script);
return $element;
}
示例11: 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;
}
示例12: 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;
}
示例13: array
<?php
/**
* http://html5doctor.com/cite-and-blockquote-reloaded/
*/
kirbytext::$tags['blockquote'] = array('attr' => array('lang', 'cite', 'link'), 'html' => function ($tag) {
$quote = $tag->attr('blockquote');
$lang = $tag->attr('lang');
$cite = $tag->attr('cite');
$link = $tag->attr('link');
$quoteTag = new Brick('blockquote');
$quoteTag->attr('lang', $lang);
$quoteTag->append(kirbytext($quote));
$cite = $cite ?: preg_replace('/^https?:\\/\\//i', null, $link);
if (!$cite) {
return $quoteTag;
}
if ($link) {
$linkTag = new Brick('a');
$linkTag->attr('href', $link);
$linkTag->append($cite);
}
$citeTag = new Brick('cite');
$citeTag->append(isset($linkTag) ? $linkTag : $cite);
$quoteTag->append($citeTag);
return $quoteTag;
});
示例14: function
<?php
return function ($page) {
// label option
$option = new Brick('a', icon('magic', 'left') . l('pages.url.uid.label.option'), array('class' => 'btn btn-icon label-option', 'href' => '#', 'data-title' => str::slug($page->title())));
// url preview
$preview = new Brick('div', '', array('class' => 'uid-preview'));
$preview->append(ltrim($page->parent()->uri() . '/', '/'));
$preview->append('<span>' . $page->slug() . '</span>');
// create the form
$form = new Kirby\Panel\Form(array('uid' => array('label' => l('pages.url.uid.label') . $option, 'type' => 'text', 'icon' => 'chain', 'autofocus' => true, 'help' => $preview, 'default' => $page->slug())));
$form->buttons->submit->val(l('change'));
$form->cancel($page);
return $form;
};
示例15: input_serialized
private function input_serialized()
{
# Wrapper
$serialized_content = new Brick('div');
$serialized_content->addClass('field-hidden field-serialized');
# Field (Hidden: Users shouldn't be able to manipulate the JSON we'll store in here)
$serialized_input = $this->input();
$serialized_input->attr('type', 'hidden');
# Combine & Ship It
$serialized_content->append($serialized_input);
return $serialized_content;
}