当前位置: 首页>>代码示例>>PHP>>正文


PHP Form::textarea方法代码示例

本文整理汇总了PHP中Form::textarea方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::textarea方法的具体用法?PHP Form::textarea怎么用?PHP Form::textarea使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Form的用法示例。


在下文中一共展示了Form::textarea方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: testTextarea

 /**
  * @covers Form::textarea
  */
 public function testTextarea()
 {
     $textZone = $this->myForm->textarea('text');
     $this->assertInstanceOf('TextArea', $textZone);
     $this->assertEquals('text', $textZone->getName());
     $this->assertSame($this->myForm, $textZone->getForm());
 }
开发者ID:fruition-sciences,项目名称:phpfw,代码行数:10,代码来源:FormTest.php

示例2: parseFields

 private function parseFields()
 {
     if (!empty($this->fields)) {
         foreach ($this->fields as $key => $value) {
             switch ($value['type']) {
                 case 'text':
                     $obj = Form::text($key);
                     break;
                 case 'long_text':
                     $obj = Form::textarea($key);
                     break;
                 case 'multiple_choice':
                     $obj = Form::checkboxes($key . "[]");
                     // create a collection of checkboxeseaa
                     foreach ($value['options'] as $o => $v) {
                         $obj->add($o, $v);
                     }
                     break;
                 default:
                     $obj = Form::text($key);
             }
             $obj->setLabel($value['label']);
             $this->add($obj);
         }
     }
     $this->init();
 }
开发者ID:alterfw,项目名称:options-page,代码行数:27,代码来源:OptionPage.php

示例3: 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;
 }
开发者ID:stabernz,项目名称:wnb,代码行数:30,代码来源:aircraft.php

示例4: testTextareaField

 /**
  * @dataProvider getFieldProvider
  *
  * @param $fieldName
  * @param $fieldTitle
  * @param $fieldValue
  * @param array  $options
  * @param string $helpText
  */
 public function testTextareaField($fieldName, $fieldTitle, $fieldValue = null, $options = [], $helpText = '')
 {
     Form::open(['url' => '/formurl']);
     $field = Form::textareaField($fieldTitle, $fieldName, $fieldValue, $options, $helpText);
     Form::close();
     $control = Form::textarea($fieldName, $fieldValue, $this->appendClassToOptions('form-control', $options));
     $this->assertEquals(Form::field($fieldTitle, $fieldName, $control, $helpText), $field);
 }
开发者ID:grozwalker,项目名称:rutorika-laravel-html,代码行数:17,代码来源:WrapFieldTest.php

示例5: li_textarea

 public static function li_textarea($fieldname, $text, $value = NULL, array $attributes = array(), $error = "")
 {
    $atts = array_merge($attributes, array('id'=>$fieldname));
    echo "<li class=\"input_field input_textarea\">";
    echo Form::label($fieldname, $text);
    echo Form::textarea($fieldname, $value, $atts);
    echo "<span class=\"error\">$error</span>";
    echo "</li>";
 }
开发者ID:nevermlnd,项目名称:cv,代码行数:9,代码来源:form.php

示例6: textAreaGroup

function textAreaGroup($name, $value = NULL, $errors)
{
    $errorClass = $errors->first($name) ? "has-error" : "";
    $output = "<div class='form-group {$errorClass}'>";
    $output .= Form::label($name, ucwords($name));
    $output .= Form::textarea($name, $value, ['class' => 'form-control', 'placeholder' => "Enter {$name}"]);
    $output .= $errors->first($name, '<label>:message</label>');
    return "{$output}</div>";
}
开发者ID:rdok,项目名称:oblivion-pm,代码行数:9,代码来源:helpers.php

示例7: displayForm

 /** inheritdoc */
 public static function displayForm($value, &$settings, $model)
 {
     $settings = static::settings($settings);
     $include_label = isset($settings['label']) ? $settings['label'] : true;
     $required = isset($settings['required']) ? $settings['required'] : false;
     $errors = $model->getErrorsForField($settings['mapping']['fieldName']);
     $has_errors = count($errors) > 0;
     // Check stylesSet URL
     $stylesSet = \Arr::get($settings, 'stylesSet');
     if (!empty($stylesSet) && substr($stylesSet, 0, 1) == '/') {
         // Add an absolute URL to the start
         $settings['stylesSet'] = rtrim(\Uri::base(false), '/') . $stylesSet;
     }
     // Add ckeditor to the class for the field
     $input_attributes = isset($settings['input_attributes']) ? $settings['input_attributes'] : array('class' => 'input-xxlarge');
     $input_attributes['class'] = $input_attributes['class'] . " ckeditor-cmf";
     $label = !$include_label ? '' : \Form::label($settings['title'] . ($required ? ' *' : '') . ($has_errors ? ' - ' . $errors[0] : ''), $settings['mapping']['fieldName'], array('class' => 'item-label'));
     $input = \Form::textarea($settings['mapping']['fieldName'], strval($value), $input_attributes);
     // Set up required information for any links specified
     if (isset($settings['links']) && is_array($settings['links'])) {
         $links = array();
         foreach ($settings['links'] as $link_type => $link) {
             if (!class_exists($link_type)) {
                 continue;
             }
             $link['table_name'] = \CMF\Admin::getTableForClass($link_type);
             $link['singular'] = $link_type::singular();
             $link['plural'] = $link_type::plural();
             $link['icon'] = $link_type::icon();
             $links[$link_type] = $link;
         }
         $settings['links'] = $links;
     }
     if (isset($settings['stylesSet'])) {
         if (file_exists(DOCROOT . ltrim($settings['stylesSet'], '/'))) {
             $settings['stylesSet'] = 'default:' . \Uri::base(false) . ltrim($settings['stylesSet'], '/');
         } else {
             unset($settings['stylesSet']);
         }
     }
     if (isset($settings['contentsCss'])) {
         if (strpos($settings['contentsCss'], '.php') === false && !file_exists(DOCROOT . ltrim($settings['contentsCss'], '/'))) {
             unset($settings['contentsCss']);
         }
     }
     // Return only the field and label if no wrap is required
     if (isset($settings['wrap']) && $settings['wrap'] === false) {
         return $label . $input;
     }
     // Return the widget
     if (isset($settings['widget']) && $settings['widget'] === true) {
         return array('assets' => array(), 'content' => $input, 'widget' => true, 'widget_title' => $settings['title'], 'widget_icon' => 'align-left', 'js_data' => $settings);
     }
     // Return the normal field
     return array('assets' => array(), 'content' => html_tag('div', array('class' => 'control-group ' . ($has_errors ? ' error' : '')), $label . $input), 'widget' => false, 'js_data' => $settings);
 }
开发者ID:soundintheory,项目名称:fuel-cmf,代码行数:57,代码来源:CKEditor.php

示例8: render

 public function render()
 {
     if ($this->_config['maxlength'] and !isset($this->_attributes['maxlength'])) {
         $this->_attributes['maxlength'] = $this->_extra[$this->_config['maxlength']];
     }
     if ($this->_config['multiline']) {
         return Form::textarea($this->_name, $this->_value, $this->_attributes + array('id' => $this->_id, 'rows' => $this->_config['multiline'], 'cols' => 120, 'class' => 'xxlarge'));
     }
     return Form::input($this->_name, $this->_value, $this->_attributes + array('id' => $this->_id, 'size' => 40));
 }
开发者ID:Zahymaka,项目名称:ZForm,代码行数:10,代码来源:text.php

示例9: smarty_function_form_textarea

/**
 * @param array                    $params
 * @param Smarty_Internal_Template $smarty
 *
 * @throws SmartyException
 * @return string
 *
 * @author Kovács Vince
 */
function smarty_function_form_textarea($params, Smarty_Internal_Template &$smarty)
{
    if (!isset($params['_name'])) {
        throw new SmartyException('Missing _name attribute for form_text tag');
    }
    $name = $params['_name'];
    $value = isset($params['_value']) ? $params['_value'] : (isset($params['_populate']) ? \Input::get($name) : null);
    unset($params['_name']);
    unset($params['_value']);
    unset($params['_populate']);
    return Form::textarea($name, $value, $params);
}
开发者ID:vi-kon,项目名称:laravel-smarty-view,代码行数:21,代码来源:function.form_textarea.php

示例10: page

function page()
{
    global $db, $session;
    //lets get a user
    $user = $db->from('users')->where('id', 1);
    $formOptions = array('action' => $_SERVER['PHP_SELF'], 'id' => 'testForm', 'data' => $user, 'files' => true, 'class' => 'form-horizontal', 'sidebar' => true, 'title' => '', 'description' => '');
    $form = new Form($formOptions, $session);
    $sidebar = array('class' => 'warning', 'title' => 'Be careful!', 'body' => 'Be sure you complete all fields');
    $form->setSidebar($sidebar);
    $emailValidation = array('required' => 'true', 'error' => 'Please supply a valid email address');
    $email = array('field' => 'email', 'label' => "Email", 'description' => '', 'validation' => $emailValidation);
    $form->email($email);
    $firstNameValidation = array();
    $firstName = array('field' => 'firstname', 'label' => "First Name", 'description' => '', 'validation' => $firstNameValidation);
    $form->text($firstName);
    $lastName = array('field' => 'lastname', 'label' => "Last Name", 'description' => 'Fill in your last name');
    $form->text($lastName);
    $taName = array('field' => 'descriptionField', 'label' => "Last Name", 'description' => 'Fill in your last name');
    $form->textarea($taName);
    $phoneOptions = array('field' => 'phone', 'label' => "Phone", 'description' => 'Home Phone');
    $form->phone($phoneOptions);
    $checkOptions = array('field' => 'checkTest', 'label' => "Check here", 'description' => 'You authorize everything');
    $form->checkbox($checkOptions);
    $passwordValidation = array('pattern' => '(?=^.{6,}$)((?=.*\\d)|(?=.*\\W+))(?![.\\n])(?=.*[A-Z])(?=.*[a-z]).*$');
    $passwordOptions = array('field' => 'password', 'label' => "Password", 'description' => 'Enter a password at least 6 characters, with at least one symbol and number.', 'validation' => $passwordValidation);
    $form->password($passwordOptions);
    /*
        $dateValidation = array('disabledDays'=>'0,1','disabledDates'=>array("11/23/2015", "12/25/2015"), 'minDate'=>'11/1/2015', 'maxDate'=>'1/30/2016');
        $secondDateValidation = array('disabledDays'=>'0,1','disabledDates'=>array("11/23/2015", "12/25/2015"), 'minDate'=>'11/1/2015', 'maxDate'=>'1/30/2016');
        $dateOptions = array('field'=>'startdate', 'label'=>'Start/Stop Dates', 'description' =>'Enter a start  and stop date', 'validation' => $dateValidation,
            'second_field'=>'enddate',  'second_validation' => $secondDateValidation );
        $form->date($dateOptions);
    
        $timeValidation = array('stepping'=>5,'disabledDays'=>'0,1','disabledDates'=>array("11/23/2015", "12/25/2015"), 'minDate'=>'11/1/2015', 'maxDate'=>'1/30/2016');
        $secondTimeValidation = array('disabledDays'=>'0,1','disabledDates'=>array("11/23/2015", "12/25/2015"), 'minDate'=>'11/1/2015', 'maxDate'=>'1/30/2016');
        $dateOptions = array('field'=>'starttime', 'label'=>'Start/Stop Times', 'description' =>'Enter a start  and stop time', 'validation' => $timeValidation,
            'second_field'=>'endtime',  'second_validation' => $secondTimeValidation );
        $form->time($dateOptions);
    */
    $timeValidation = array('stepping' => 5, 'disabledDays' => '0,1', 'disabledDates' => array("11/23/2015", "12/25/2015"), 'minDate' => '11/1/2015', 'maxDate' => '1/30/2016');
    $secondTimeValidation = array('stepping' => 5, 'disabledDays' => '0,1', 'disabledDates' => array("11/23/2015", "12/25/2015"), 'minDate' => '11/1/2015', 'maxDate' => '1/30/2016');
    $dateOptions = array('field' => 'startdatetime', 'label' => 'Start/Stop Date Times', 'description' => 'Enter a start  and stop date time', 'validation' => $timeValidation, 'second_field' => 'enddatetime', 'second_validation' => $secondTimeValidation);
    $form->datetime($dateOptions);
    $options = array('field' => 'department', 'options' => array(0 => 'Advertising', 1 => "Circulation", 2 => 'Production'), 'label' => 'Department', 'description' => 'Select your department');
    $form->select($options);
    $options = array('field' => 'publications', 'url' => '/ajax/forms/publications.php', 'label' => 'Publication', 'description' => 'Select a publication');
    $form->remoteSelect($options);
    $form->generate();
    //var_dump($this->formScripts);
    //grab any form scripts and append them to the global scripts array
    $GLOBALS['scripts'] = array_merge($GLOBALS['scripts'], $form->formScripts);
}
开发者ID:Pioneer-Web-Development,项目名称:MangoV2,代码行数:52,代码来源:forms.php

示例11: render

 public function render()
 {
     $attributes = $this->get_attributes();
     if (isset($attributes['style'])) {
         $attributes['style'] .= ' width: 100%;';
     } else {
         $attributes['style'] = 'width: 100%;';
     }
     $attributes['style'] .= ' height: 150px;';
     $attributes['style'] .= ' resize: none;';
     $attributes['style'] .= ' padding: 5px 5px 5px 10px;';
     return Form::textarea($this->get_name(), $this->get_value()->get_raw(), $attributes);
 }
开发者ID:ariol,项目名称:adminshop,代码行数:13,代码来源:Text.php

示例12: displayForm

 /** inheritdoc */
 public static function displayForm($value, &$settings, $model)
 {
     $settings = static::settings($settings);
     $include_label = isset($settings['label']) ? $settings['label'] : true;
     $required = isset($settings['required']) ? $settings['required'] : false;
     $errors = $model->getErrorsForField($settings['mapping']['fieldName']);
     $has_errors = count($errors) > 0;
     $attributes = array('class' => 'controls control-group ' . ($has_errors ? ' error' : ''));
     $input_attributes = isset($settings['input_attributes']) ? $settings['input_attributes'] : array('class' => 'input-xxlarge');
     //add redactor to the class for the field
     $input_attributes['class'] = $input_attributes['class'] . " redactor";
     $label_text = $settings['title'] . ($required ? ' *' : '');
     $input = \Form::textarea($settings['mapping']['fieldName'], strval($value), $input_attributes);
     // Translation?
     if (\CMF::$lang_enabled && !\CMF::langIsDefault() && $model->isTranslatable($settings['mapping']['columnName'])) {
         // If there is no translation
         if (!$model->hasTranslation($settings['mapping']['columnName'])) {
             $attributes['class'] .= ' no-translation';
             $label_text = '<span class="no-translation"><img class="lang-flag" src="' . \Uri::create('/admin/assets/img/lang/' . \CMF::defaultLang() . '.png') . '" />&nbsp; ' . $label_text . '</span>';
         } else {
             $label_text = '<img class="lang-flag" src="' . \Uri::create('/admin/assets/img/lang/' . \CMF::lang() . '.png') . '" />&nbsp; ' . $label_text;
         }
     }
     // Build the label
     $label = !$include_label ? '' : \Form::label($label_text . ($has_errors ? ' - ' . $errors[0] : ''), $settings['mapping']['fieldName'], array('class' => 'item-label'));
     // Set up required information for any links specified
     if (isset($settings['links']) && is_array($settings['links'])) {
         $links = array();
         foreach ($settings['links'] as $link_type => $link) {
             if (!class_exists($link_type)) {
                 continue;
             }
             $link['table_name'] = \CMF\Admin::getTableForClass($link_type);
             $link['singular'] = $link_type::singular();
             $link['plural'] = $link_type::plural();
             $link['icon'] = $link_type::icon();
             $links[$link_type] = $link;
         }
         $settings['links'] = $links;
     }
     // Return only the field and label if no wrap is required
     if (isset($settings['wrap']) && $settings['wrap'] === false) {
         return $label . $input;
     }
     // Return the widget
     if (isset($settings['widget']) && $settings['widget'] === true) {
         return array('assets' => array(), 'content' => $input, 'widget' => true, 'widget_title' => $label_text, 'widget_icon' => 'align-left', 'js_data' => $settings);
     }
     // Return the normal field
     return array('assets' => array(), 'content' => html_tag('div', $attributes, $label . $input), 'widget' => false, 'js_data' => $settings);
 }
开发者ID:soundintheory,项目名称:fuel-cmf,代码行数:52,代码来源:Redactor.php

示例13: input

 public function input($name, $value, array $attr = NULL)
 {
     $input[] = '<script type="text/javascript">';
     $input[] = 'tinyMCE.init({';
     $input[] = 'mode: "exact",';
     $input[] = 'elements : "' . $name . '",';
     $options = Kohana::config('tinymce');
     foreach ($options as $key => $option) {
         $input[] = $key . ' : "' . $option . '",';
     }
     $input[] = '});';
     $input[] = '</script>';
     if (!isset($attr['id'])) {
         $attr['id'] = $name;
     }
     $input[] = Form::textarea($name, $value, $attr);
     return "\n" . implode("\n", $input) . "\n";
 }
开发者ID:kerkness,项目名称:shindig,代码行数:18,代码来源:tinymce.php

示例14: displayForm

 /** inheritdoc */
 public static function displayForm($value, &$settings, $model)
 {
     $settings = static::settings($settings);
     $include_label = isset($settings['label']) ? $settings['label'] : true;
     $required = isset($settings['required']) ? $settings['required'] : false;
     $errors = $model->getErrorsForField($settings['mapping']['fieldName']);
     $has_errors = count($errors) > 0;
     $input_attributes = isset($settings['input_attributes']) ? $settings['input_attributes'] : array('class' => 'input-xxlarge');
     $attributes = array('class' => 'controls control-group' . ($has_errors ? ' error' : ''));
     $input = \Form::textarea($settings['mapping']['fieldName'], strval($value), $input_attributes);
     $label_text = $settings['title'] . ($required ? ' *' : '');
     // Translation?
     if (\CMF::$lang_enabled && !\CMF::langIsDefault() && isset($settings['mapping']['columnName']) && $model->isTranslatable($settings['mapping']['columnName'])) {
         // If there is no translation
         if (!$model->hasTranslation($settings['mapping']['columnName'])) {
             $attributes['class'] .= ' no-translation';
             $label_text = '<img class="lang-flag" src="' . \Uri::create('/admin/assets/img/lang/' . \CMF::defaultLang() . '.png') . '" />&nbsp; ' . $label_text;
         } else {
             $label_text = '<img class="lang-flag" src="' . \Uri::create('/admin/assets/img/lang/' . \CMF::lang() . '.png') . '" />&nbsp; ' . $label_text;
         }
     }
     // Build the label
     $label = !$include_label ? '' : html_tag('label', array('class' => 'item-label', 'for' => $settings['mapping']['fieldName']), $label_text . ($has_errors ? ' - ' . $errors[0] : ''));
     if (isset($settings['prepend'])) {
         $input = html_tag('div', array('class' => 'input-prepend'), html_tag('span', array('class' => 'add-on'), $settings['prepend']) . $input);
     }
     if (isset($settings['append'])) {
         $input = html_tag('div', array('class' => 'input-append'), $input . html_tag('span', array('class' => 'add-on'), $settings['append']));
     }
     if (isset($settings['wrap']) && $settings['wrap'] === false) {
         return $label . $input;
     }
     $description = isset($settings['description']) ? '<span class="help-block">' . $settings['description'] . '</span>' : '';
     // Add the 'keep updated' control if the field has a template
     if (isset($settings['template']) && !empty($settings['template'])) {
         $attributes['class'] .= ' field-with-controls field-with-template';
         $auto_update_setting = 'settings[' . $settings['mapping']['fieldName'] . '][auto_update]';
         $auto_update_content = \Form::hidden($auto_update_setting, '0', array()) . html_tag('label', array('class' => 'checkbox auto-update-label'), \Form::checkbox($auto_update_setting, '1', \Arr::get($settings, 'auto_update', true), array('class' => 'auto-update')) . strtolower(\Lang::get('admin.common.auto_update')));
         $auto_update = html_tag('div', array('class' => 'controls-top'), $auto_update_content);
         $label .= $auto_update;
         return array('content' => html_tag('div', $attributes, $label . $description . $input) . '<div class="clear"><!-- --></div>', 'widget' => false, 'assets' => array('js' => array('/admin/assets/js/twig.min.js', '/admin/assets/js/fields/template.js')), 'js_data' => $settings);
     }
     return html_tag('div', $attributes, $label . $description . $input);
 }
开发者ID:soundintheory,项目名称:fuel-cmf,代码行数:45,代码来源:Textarea.php

示例15: getElement

 /**
  * @param FormSchema $field
  * @param bool $useLabels
  * @return string the Element to return
  */
 public static function getElement(FormSchema $field, $useLabels = true)
 {
     $returnElement = null;
     $types = \Config::get('formbuilder::config.form-types');
     $options = \Config::get('formbuilder::config.form-options');
     $options = array_key_exists($field->getType(), $options) ? $options[$field->getType()] : null;
     if ($useLabels) {
         $returnElement .= \Form::label($field->getName(), ucfirst($field->getName()));
     }
     if (method_exists('\\Illuminate\\Html\\FormBuilder', $field->getName())) {
         $method = $field->getName();
         $returnElement .= \Form::$method($field->getName(), null);
     } elseif (method_exists('\\Illuminate\\Html\\FormBuilder', $field->getType()) && $field->getType() != 'text') {
         $method = $field->getType();
         $returnElement .= \Form::$method($field->getName(), null);
     } elseif ($field->getType() == 'text') {
         $returnElement .= \Form::textarea($field->getName(), null);
     } else {
         $returnElement .= \Form::input($types[$field->getType()], $field->getName(), $field->getType() == 'boolean' ? 0 : null, $options);
     }
     return $returnElement;
 }
开发者ID:derduesseldorf,项目名称:formbuilder,代码行数:27,代码来源:FormElement.php


注:本文中的Form::textarea方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。