本文整理汇总了PHP中Brick::val方法的典型用法代码示例。如果您正苦于以下问题:PHP Brick::val方法的具体用法?PHP Brick::val怎么用?PHP Brick::val使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Brick
的用法示例。
在下文中一共展示了Brick::val方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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()));
if (!is_array($this->value())) {
$input->val(html($this->value(), false));
}
if ($this->readonly()) {
$input->attr('tabindex', '-1');
$input->addClass('input-is-readonly');
}
return $input;
}
示例2: inputField
public function inputField($value)
{
$site = site();
$input = new Brick('input', null);
$input->addClass('input');
$input->attr(array('type' => $this->type(), 'value' => $value, 'required' => $this->required(), 'name' => $this->name() . '[]', 'autocomplete' => $this->autocomplete() === false ? 'off' : 'on', 'autofocus' => $this->autofocus(), 'readonly' => $this->readonly(), 'disabled' => $this->disabled(), 'id' => $this->id()));
if (!is_array($value)) {
$input->val(html($value, false));
}
if ($this->readonly()) {
$input->attr('tabindex', '-1');
$input->addClass('input-is-readonly');
}
// Content page doesn't exist anymore?
if (!($contentPage = $this->page()->find($value))) {
return FALSE;
}
// Show input field as hidden to keep data on page save/update
$input->addClass('hidden');
// Show list of content pages
$input .= '<div><a href="' . url('panel/pages/' . $contentPage->uri() . '/edit') . '" class="input input-is-readonly">' . $contentPage->title()->kt() . '</a></div>';
return $input;
}
示例3: input_lng
private function input_lng()
{
# Wrapper
$lng_content = new Brick('div');
$lng_content->addClass('field-content field-lng');
# Input (Locked: We use the map UI to update these)
$lng_input = new Brick('input');
$lng_input->attr('tabindex', '-1');
$lng_input->attr('readonly', true);
$lng_input->addClass('input input-split-right input-is-readonly place-lng');
$lng_input->attr('placeholder', l::get('fields.place.longitude', 'Longitude'));
$lng_input->val($this->pick('lng'));
# Combine & Ship It
$lng_content->append($lng_input);
return $lng_content;
}