本文整理匯總了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;
}