本文整理汇总了PHP中Form::input方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::input方法的具体用法?PHP Form::input怎么用?PHP Form::input使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form
的用法示例。
在下文中一共展示了Form::input方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* Renders the object
*
* @return string
*/
public function render()
{
$input = $this->form->input($this->type, $this->name, $this->value, $this->options);
if (!$this->label) {
return (string) $input;
}
$attributes = new Attributes($this->attributes, ['class' => $this->type]);
$input .= '<span>' . $this->label . '</span>';
$label = '<label>' . $input . '</label>';
return "<div {$attributes}>{$label}</div>";
}
示例2: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
echo Form::open();
?>
<fieldset>
<?php
echo Form::control_group(Form::input('name', $this->tag->name, array('class' => 'input-xxlarge', 'maxlength' => 32)), array('name' => __('Name')), Arr::get($this->errors, 'name'));
?>
<?php
echo Form::control_group(Form::input('description', $this->tag->description, array('class' => 'input-xxlarge')), array('description' => __('Short description')), Arr::get($this->errors, 'description'));
?>
</fieldset>
<fieldset class="form-actions">
<?php
echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
?>
<?php
echo HTML::anchor(Request::back(Route::url('tags'), true), __('Cancel'), array('class' => 'cancel'));
?>
</fieldset>
<?php
echo Form::close();
return ob_get_clean();
}
示例3: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
$tags = $this->group->tags();
if (empty($tags)) {
?>
<div class="empty">
<?php
echo __('No tags yet.');
?>
</div>
<?php
} else {
?>
<ul>
<?php
foreach ($tags as $tag) {
?>
<li><?php
echo HTML::anchor(Route::model($tag), $tag->name);
?>
</li>
<?php
}
?>
</ul>
<?php
}
echo Form::open();
?>
<fieldset>
<?php
echo Form::control_group(Form::input('name', $this->group->name, array('class' => 'input-xxlarge', 'maxlength' => 32)), array('name' => __('Name')), Arr::get($this->errors, 'name'));
?>
<?php
echo Form::control_group(Form::input('description', $this->group->description, array('class' => 'input-xxlarge')), array('description' => __('Short description')), Arr::get($this->errors, 'description'));
?>
</fieldset>
<fieldset class="form-actions">
<?php
echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
?>
<?php
echo HTML::anchor(Request::back(Route::url('tags'), true), __('Cancel'), array('class' => 'cancel'));
?>
</fieldset>
<?php
echo Form::close();
return ob_get_clean();
}
示例4: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
echo Form::open();
?>
<fieldset>
<?php
echo Form::control_group(Form::input('name', $this->blog_entry->name, array('class' => 'input-xxlarge')), array('name' => __('Title')), Arr::get($this->errors, 'name'));
?>
<?php
echo Form::control_group(Form::textarea_editor('content', $this->blog_entry->content, array('class' => 'input-xxlarge'), true), array('content' => __('Content')), Arr::get($this->errors, 'content'));
?>
</fieldset>
<fieldset class="form-actions">
<?php
echo Form::csrf();
?>
<?php
echo Form::button('save', __('Save'), array('type' => 'submit', 'class' => 'btn btn-success btn-large'));
?>
<?php
echo $this->cancel ? HTML::anchor($this->cancel, __('Cancel'), array('class' => 'cancel')) : '';
?>
</fieldset>
<?php
echo Form::close();
return ob_get_clean();
}
示例5: view
public function view()
{
// Group's inputs.
$name_group_inputs = [View::forge('form/group/input', ['label_coltype' => 'col-xs-2', 'input_coltype' => 'col-xs-4', 'input' => Form::input('name', $this->requested_aircraft->name, ['class' => 'form-control', 'type' => 'text']), 'label' => 'A/C Name'], false)];
$general_group_1_inputs = [View::forge('form/group/input', ['label_coltype' => 'col-xs-2', 'input_coltype' => 'col-xs-4', 'input' => Form::input('basic_empty_weight', $this->requested_aircraft->basic_empty_weight, ['class' => 'form-control', 'type' => 'number']) . "kg", 'label' => 'Basic Empty Weight'], false), View::forge('form/group/input', ['label_coltype' => 'col-xs-2', 'input_coltype' => 'col-xs-4', 'input' => Form::input('cg_position', $this->requested_aircraft->cg_position, ['class' => 'form-control', 'type' => 'number']) . "aft of datum", 'label' => 'C of G Position'], false)];
$description_group_inputs = [View::forge('form/group/input', ['label_coltype' => 'col-xs-12', 'input_coltype' => 'col-xs-12', 'input' => Form::textarea('description', $this->requested_aircraft->description, ['class' => 'form-control']), 'label' => 'Description', 'label_left' => true], false)];
$weight_limits_group_1_inputs = [View::forge('form/group/input', ['label_coltype' => 'col-xs-2', 'input_coltype' => 'col-xs-4', 'input' => Form::input('max_ramp_weight', $this->requested_aircraft->max_ramp_weight, ['class' => 'form-control', 'type' => 'text']), 'label' => 'Max Ramp Weight'], false), View::forge('form/group/input', ['label_coltype' => 'col-xs-2', 'input_coltype' => 'col-xs-4', 'input' => Form::input('mctow', $this->requested_aircraft->mctow, ['class' => 'form-control', 'type' => 'text']), 'label' => 'MCTOW'], false)];
$weight_limits_group_2_inputs = [View::forge('form/group/input', ['label_coltype' => 'col-xs-2', 'input_coltype' => 'col-xs-4', 'input' => Form::input('mlw', $this->requested_aircraft->mlw, ['class' => 'form-control', 'type' => 'text']), 'label' => 'MLW'], false), View::forge('form/group/input', ['label_coltype' => 'col-xs-2', 'input_coltype' => 'col-xs-4', 'input' => Form::input('mzfw', $this->requested_aircraft->mzfw, ['class' => 'form-control', 'type' => 'text']), 'label' => 'MZFW'], false)];
$arms_table_template = View::forge('widgets/tablewithactions/template', ['duplicate_action' => false, 'cells' => [View::forge('widgets/tablewithactions/row/cell', ['cell_content' => Form::input('_name', '', ['class' => 'form-control'])], false), View::forge('widgets/tablewithactions/row/cell', ['cell_content' => Form::input('_position', '', ['class' => 'form-control'])], false), View::forge('widgets/tablewithactions/row/cell', ['cell_content' => Form::input('_value', '', ['class' => 'form-control']) . Form::hidden('_type', 'arm')], false)]]);
$arms_table = View::forge('widgets/tablewithactions', ['template_row' => $arms_table_template, 'name' => '_arms', 'coltype' => 'col-xs-12 col-md-6', 'headings' => ['<th>Label</th>', '<th>Arm (aft of datum)</th>', '<th>Max Weight</th>'], 'rows' => $this->arms_table_rows], false);
$cglimits_table_template = View::forge('widgets/tablewithactions/template', ['duplicate_action' => false, 'cells' => [View::forge('widgets/tablewithactions/row/cell', ['cell_content' => Form::input('_position', '', ['class' => 'form-control'])], false), View::forge('widgets/tablewithactions/row/cell', ['cell_content' => Form::input('_value', '', ['class' => 'form-control']) . Form::hidden('_type', 'maxweight') . Form::hidden('_name', 'limit')], false)]]);
$cglimits_table = View::forge('widgets/tablewithactions', ['template_row' => $cglimits_table_template, 'name' => '_arms', 'coltype' => 'col-xs-6', 'headings' => ['<th>Arm (aft of datum)</th>', '<th>Weight Limit</th>'], 'rows' => $this->cglimits_table_rows], false);
$button_group_1_inputs = [Asset::js('tablewithactions.js', false), View::forge('form/button', ['coltype' => 'col-xs-offset-5 col-xs-2', 'link' => 'submit/aircraft/' . $this->id, 'response_target' => './aircraft_form', 'class' => 'form-control btn-success', 'label' => 'Save Changes'], false)];
// Headings
$general_heading = View::forge('form/heading', ['text' => 'General', 'size' => 4], false);
$weight_limits_heading = View::forge('form/heading', ['text' => 'Weight Limits', 'size' => 4], false);
$arms_heading = View::forge('form/heading', ['text' => 'Arms', 'size' => 4], false);
$cg_limits_heading = View::forge('form/heading', ['text' => 'C of G Limits', 'size' => 4], false);
// Groups
$name_group = View::forge('form/group', ['inputs' => $name_group_inputs], false);
$general_group_1 = View::forge('form/group', ['inputs' => $general_group_1_inputs], false);
$description_group = View::forge('form/group', ['inputs' => $description_group_inputs], false);
$weight_limits_group_1 = View::forge('form/group', ['inputs' => $weight_limits_group_1_inputs]);
$weight_limits_group_2 = View::forge('form/group', ['inputs' => $weight_limits_group_2_inputs]);
$buttons_group = View::forge('form/group', ['inputs' => $button_group_1_inputs], false);
$cg_limits_group = View::forge('form/group', ['inputs' => ['<div class="col-xs-6">' . $cglimits_table . '</div>' . '<div class="col-xs-6">' . 'Graph here' . '</div>']], false);
$weightandbalance_section_data = ['heading' => 'Weight and Balance Data', 'unique_id' => Str::random('uuid'), 'groups' => [$general_heading, $name_group, $general_group_1, $description_group, $weight_limits_heading, $weight_limits_group_1, $weight_limits_group_2, $arms_heading, $arms_table, $cg_limits_heading, $cg_limits_group, $buttons_group]];
$weightandbalance_section = View::forge('form/section', $weightandbalance_section_data, false);
$this->aircraft_form = $weightandbalance_section;
}
示例6: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
$gallery = $this->image->gallery();
echo Form::open(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $this->image->id, 'action' => 'report')), array('class' => Request::current()->is_ajax() ? 'ajaxify' : ''));
?>
<fieldset>
<?php
echo Form::control_group(Form::input('reason', null, array('class' => 'input-block-level')), array('name' => __('Reason')), null, __('You can enter an optional reason for reporting this image, e.g. why it should be removed'));
?>
</fieldset>
<fieldset class="form-actions">
<?php
echo Form::button('save', __('Report'), array('type' => 'submit', 'class' => 'btn btn-danger btn-large'));
?>
<?php
echo Request::current()->is_ajax() ? '' : HTML::anchor(Route::url('gallery_image', array('gallery_id' => Route::model_id($gallery), 'id' => $this->image->id, 'action' => '')), __('Cancel'), array('class' => 'cancel'));
?>
<?php
echo Form::csrf();
?>
</fieldset>
<?php
return ob_get_clean();
}
示例7: displayForm
public static function displayForm($value, &$settings, $model)
{
$settings = static::settings($settings);
if (!is_array($value)) {
$value = array();
}
// Search input or
$searchInput = \Form::input($settings['mapping']['fieldName'] . '[search]', null, array('class' => 'input input-xxlarge search-input', 'placeholder' => \Lang::get('admin.common.map_search_placeholder')));
$searchButton = \Form::button('mapsearch', \Lang::get('admin.verbs.search'), array('class' => 'btn btn-primary'));
$searchInput = html_tag('div', array('class' => 'form form-inline search-form'), $searchInput . $searchButton);
// Hidden inputs
$latInput = \Form::hidden($settings['mapping']['fieldName'] . '[lat]', \Arr::get($value, 'lat'), array('class' => 'lat'));
$lngInput = \Form::hidden($settings['mapping']['fieldName'] . '[lng]', \Arr::get($value, 'lng'), array('class' => 'lng'));
$zoomInput = \Form::hidden($settings['mapping']['fieldName'] . '[zoom]', \Arr::get($value, 'zoom'), array('class' => 'zoom'));
// Other elements
$required = isset($settings['required']) ? $settings['required'] : false;
$label_text = $settings['title'] . ($required ? ' *' : '');
$label = \Form::label($label_text);
$mapDiv = html_tag('div', array('class' => 'map', 'id' => \Inflector::friendly_title($settings['mapping']['fieldName'], '-', true) . '-bing-map'), ' ');
// Check that we have an API key
if (empty($settings['api_key'])) {
$content = $label . '<div class="well"><p>' . \Lang::get('admin.bing.api_key_not_set') . '</p></div>';
} else {
$content = $label . $searchInput . $latInput . $lngInput . $zoomInput . $mapDiv;
}
$content = html_tag('div', array('class' => 'controls control-group field-type-bing-map', 'data-field-name' => $settings['mapping']['fieldName']), $content);
return array('content' => $content, 'js_data' => $settings);
}
示例8: input
public static function input($type, $name, $options = array())
{
$value = Form::getValueAttribute($name);
//Si el valor es un numero, redondear 5 decimales.
if (is_numeric($value)) {
$value = round($value, 5);
}
//Si el modelo ya tiene este atributo se le da importancia.
if ($value != null) {
$options['value'] = $value;
}
$full_name = self::getName($name);
$id = self::getClass($name);
if (isset($options['class']) && $options['class'] != '') {
//Si ya tiene clase se añade la generada a la lista de clases
$options['class'] = $options['class'] . ' ' . $id;
} else {
//Si no se usa esta clase como única
$options['class'] = $id;
}
if (!self::$is_array && !isset($options['id'])) {
//Si el modelo es unico y no existe id.
$options['id'] = $id;
}
return Form::input($type, $full_name, $value, $options);
}
示例9: content
/**
* Render view.
*
* @return string
*/
public function content()
{
ob_start();
echo $this->message;
echo Form::open();
echo Form::control_group(Form::input('email', $this->email, array('class' => 'input input-xxlarge', 'placeholder' => __('Username or email'))), array('email' => __('Send my new password to')), null, __('We will send you a "new" password generated from your old forgotten password.<br /><em>Please change your password after signing in!</em>'));
echo Form::button(null, '<i class="icon-envelope icon-white"></i> ' . __('Send'), array('class' => 'btn btn-primary'));
echo Form::close();
?>
<hr />
<blockquote cite="http://dilbert.com/strips/comic/1996-09-05/">
<dl class="dl-horizontal">
<dt>Asok:</dt> <dd>I have forgotten my password. I humbly beg for assistance.</dd>
<dt>Dogbert:</dt> <dd>I have no time for boring administrative tasks, you fool! I'm too busy upgrading the network.</dd>
<dt>Asok:</dt> <dd>You could have given me a new password in the time it took to belittle me.</dd>
<dt>Dogbert:</dt> <dd>Yeah, but which option would give me job satisfaction?</dd>
</dl>
<small class="pull-right"><a href="http://dilbert.com/strips/comic/1996-09-05/">Dilbert</a></small>
</blockquote>
<?php
return ob_get_clean();
}
示例10: form_columns
public function form_columns()
{
return array('id' => array('type' => 'input', 'editable' => FALSE), 'name' => array('type' => 'input'), 'job' => array('type' => 'select', 'choices' => array($this, 'get_types')), 'date_start' => array('type' => function ($object, $field, $attributes) {
return Form::input($field, $object->date_start(), $attributes);
}), 'date_end' => array('type' => function ($object, $field, $attributes) {
return Form::input($field, $object->date_end(), $attributes);
}));
}
示例11: input
public function input($name, array $attr = NULL)
{
if (is_array($this->choices)) {
return Form::select($name, $this->choices, $this->value, $attr);
} else {
return Form::input($name, $this->verbose(), $attr);
}
}
示例12: testInput
public function testInput()
{
$data = Form::input('text');
$this->assertEquals('<input type="text"/>', $data);
$data = Form::input('email', 'noreply@email.com');
$this->assertEquals('<input type="email" value="noreply@email.com"/>', $data);
$data = Form::input('email', 'noreply@email.com', ['id' => 'ID', 'class' => 'Class']);
$this->assertEquals('<input type="email" value="noreply@email.com" id="ID" class="Class"/>', $data);
}
示例13: view
public function view()
{
$form_sections = [View::forge('form/group', ['inputs' => [View::forge('form/group/input', ['label' => 'Flight Record or Manifest ID', 'label_left' => true, 'label_coltype' => 'col-xs-12', 'input_coltype' => 'col-xs-12', 'input' => Form::input('id', '', ['class' => 'form-control'])], false)]], false)];
$form = View::forge('form/container', ['name' => 'start', 'sections' => $form_sections, 'buttons' => [View::forge('form/button', ['label' => 'GO!', 'link' => 'view/search', 'class' => 'btn btn-success', 'coltype' => 'col-xs-offset-5 col-xs-2'], false), View::forge('form/button', ['label' => 'test!', 'link' => 'view/manifest', 'class' => 'btn btn-success', 'coltype' => 'col-xs-offset-5 col-xs-2'], false)]], false);
$panel_content = '<img src="http://skylineaviation.co.nz/assets/img/skyline-aviation-logo.svg" style="margin:10px auto 20px auto;width:50%"></img>';
$panel_content .= $form;
$panel = View::forge('layout/panel_simple', ['content' => $panel_content], false);
$this->start = $panel;
}
示例14: input
public function input($name, array $attr = array())
{
$attr['type'] = 'file';
$r = Form::input($name, '', $attr);
if ($this->value != '') {
$r .= HTML::image($this->__toString());
}
return $r;
}
示例15: li_input
public static function li_input($input, $text = NULL, $value = NULL, array $attributes = array(), $error = "")
{
$atts = array_merge($attributes, array('id'=>$input));
echo "<li class=\"input_field input_text\">";
echo Form::label($input, $text);
echo Form::input($input, $value, $atts);
echo "<span class=\"error\">$error</span>";
echo "</li>";
}