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


PHP form_input函数代码示例

本文整理汇总了PHP中form_input函数的典型用法代码示例。如果您正苦于以下问题:PHP form_input函数的具体用法?PHP form_input怎么用?PHP form_input使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


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

示例1: build

 function build()
 {
     if (!isset($this->size)) {
         $this->size = 45;
     }
     $this->_getValue();
     $output = "";
     switch ($this->status) {
         case "disabled":
         case "show":
             if (!isset($this->value)) {
                 $output = RAPYD_FIELD_SYMBOL_NULL;
             } elseif ($this->value == "") {
                 $output = "";
             } else {
                 $output = nl2br(htmlspecialchars($this->value));
             }
             break;
         case "create":
         case "modify":
             $value = $this->type == "password" ? "" : $this->value;
             $attributes = array('name' => $this->name, 'id' => $this->id, 'type' => $this->type, 'value' => $value, 'maxlength' => $this->maxlength, 'size' => $this->size, 'onclick' => $this->onclick, 'onchange' => $this->onchange, 'class' => $this->css_class, 'style' => $this->style);
             if ($this->readonly) {
                 $attributes['readonly'] = 'readonly';
             }
             $output = form_input($attributes) . $this->extra_output;
             break;
         case "hidden":
             $attributes = array('name' => $this->name, 'id' => $this->id, 'type' => "hidden", 'value' => $this->value);
             $output = form_input($attributes) . $this->extra_output;
             break;
         default:
     }
     $this->output = "\n" . $output . "\n";
 }
开发者ID:codethics,项目名称:proteoerp,代码行数:35,代码来源:input2.php

示例2: random_pages_widget_form

function random_pages_widget_form($num = 1)
{
    $widget = 'random_pages_widget_' . $num;
    // имя для формы и опций = виджет + номер
    // получаем опции
    $options = mso_get_option($widget, 'plugins', array());
    if (!isset($options['header'])) {
        $options['header'] = '';
    }
    if (!isset($options['count'])) {
        $options['count'] = 3;
    }
    if (!isset($options['page_type'])) {
        $options['page_type'] = 'blog';
    }
    if (!isset($options['page_content'])) {
        $options['page_content'] = false;
    }
    // вывод самой формы
    $CI =& get_instance();
    $CI->load->helper('form');
    $form = mso_widget_create_form(t('Заголовок'), form_input(array('name' => $widget . 'header', 'value' => $options['header'])), '');
    $form .= mso_widget_create_form(t('Количество'), form_input(array('name' => $widget . 'count', 'value' => $options['count'])), '');
    $form .= mso_widget_create_form(t('Тип страниц'), form_input(array('name' => $widget . 'page_type', 'value' => $options['page_type'])), '');
    $form .= mso_widget_create_form(' ', form_checkbox(array('name' => $widget . 'page_content', 'checked' => $options['page_content'], 'value' => 'page_content')) . ' ' . t('Показывать содержимое'), '');
    return $form;
}
开发者ID:Kmartynov,项目名称:cms,代码行数:27,代码来源:index.php

示例3: display_settings

 /**
  * Display settings sub-form for this variable type
  *
  * @param      mixed     $var_id        The id of the variable: 'new' or numeric
  * @param      array     $var_settings  The settings of the variable
  * @return     array
  */
 function display_settings($var_id, $var_settings)
 {
     // -------------------------------------
     //  Init return value
     // -------------------------------------
     $r = array();
     // -------------------------------------
     //  Check current value from settings
     // -------------------------------------
     $rows = $this->get_setting('rows', $var_settings);
     // -------------------------------------
     //  Build settings for rows
     // -------------------------------------
     $r[] = array($this->setting_label(lang('variable_rows')), form_input(array('name' => $this->input_name('rows'), 'value' => $rows, 'maxlength' => '4', 'class' => 'x-small')));
     // -------------------------------------
     //  Build settings text_direction
     // -------------------------------------
     $dir_options = '';
     foreach (array('ltr', 'rtl') as $dir) {
         $dir_options .= '<label class="low-radio">' . form_radio($this->input_name('text_direction'), $dir, $this->get_setting('text_direction', $var_settings) == $dir) . ' ' . lang("text_direction_{$dir}") . '</label>';
     }
     $r[] = array($this->setting_label(lang('text_direction')), $dir_options);
     // -------------------------------------
     //  Return output
     // -------------------------------------
     return $r;
 }
开发者ID:kentonquatman,项目名称:iofa,代码行数:34,代码来源:vt.low_rte.php

示例4: last_comments_widget_form

function last_comments_widget_form($num = 1)
{
    $widget = 'last_comments_widget_' . $num;
    // имя для формы и опций = виджет + номер
    // получаем опции
    $options = mso_get_option($widget, 'plugins', array());
    if (!isset($options['header'])) {
        $options['header'] = '';
    }
    if (!isset($options['count'])) {
        $options['count'] = 5;
    }
    if (!isset($options['words'])) {
        $options['words'] = 20;
    }
    if (!isset($options['maxchars'])) {
        $options['maxchars'] = 20;
    }
    // вывод самой формы
    $CI =& get_instance();
    $CI->load->helper('form');
    $form = mso_widget_create_form(t('Заголовок'), form_input(array('name' => $widget . 'header', 'value' => $options['header'])), '');
    $form .= mso_widget_create_form(t('Количество'), form_input(array('name' => $widget . 'count', 'value' => $options['count'])), '');
    $form .= mso_widget_create_form(t('Количество слов'), form_input(array('name' => $widget . 'words', 'value' => $options['words'])), '');
    $form .= mso_widget_create_form(t('Количество символов в одном слове'), form_input(array('name' => $widget . 'maxchars', 'value' => $options['maxchars'])), '');
    return $form;
}
开发者ID:Kmartynov,项目名称:cms,代码行数:27,代码来源:index.php

示例5: get_newsletter_form

 public function get_newsletter_form()
 {
     /* BENCHMARK */
     $this->benchmark->mark('func_get_newsletter_form_start');
     $this->load->helper('data');
     $newsletter_html = '';
     // only make a newsletter form if users who are not site admins are signed in
     /*if ('super_admin'==$this->user['user_type'] or
           'admin_user'==$this->user['user_type'] or
           'supplier_user'==$this->user['user_type'])
       {
           $newsletter_html.='';
       }
       else
       {*/
     $attr = array('name' => 'newsletter_form', 'id' => 'newsletter_form', 'class' => 'form');
     $hidden = array('url' => uri_string());
     // reload url
     $newsletter_html .= form_open('newsletter/signup', $attr, $hidden);
     // email field
     $attr = array('name' => 'newsletter_email', 'id' => 'newsletter_email', 'class' => 'form_field', 'placeholder' => 'enter your email ...', 'value' => get_value(null, 'newsletter_email'));
     $newsletter_html .= form_input($attr, '');
     $newsletter_html .= form_input(array('name' => 'phone_number', 'class' => 'phone_number', 'style' => 'position:absolute;top:-10000px;'));
     // submit button
     $attr = array('name' => 'submit', 'id' => 'newsletter_submit', 'class' => 'checkout submit');
     $newsletter_html .= form_submit($attr, 'sign up');
     $newsletter_html .= form_close();
     /*}*/
     /* BENCHMARK */
     $this->benchmark->mark('func_get_newsletter_form_end');
     return $newsletter_html;
 }
开发者ID:toni-leigh,项目名称:core,代码行数:32,代码来源:newsletter_model.php

示例6: top_commentators_widget_form

function top_commentators_widget_form($num = 1)
{
    $widget = 'top_commentators_widget_' . $num;
    // имя для формы и опций = виджет + номер
    // получаем опции
    $options = mso_get_option($widget, 'plugins', array());
    if (!isset($options['header'])) {
        $options['header'] = '';
    }
    if (!isset($options['format'])) {
        $options['format'] = '[LINK_URL][NAME][/LINK]<sup>[COUNT]</sup>';
    }
    if (!isset($options['commentators_cnt'])) {
        $options['commentators_cnt'] = 10;
    }
    if (!isset($options['days'])) {
        $options['days'] = 30;
    }
    // вывод самой формы
    $CI =& get_instance();
    $CI->load->helper('form');
    $form = mso_widget_create_form(t('Заголовок'), form_input(array('name' => $widget . 'header', 'value' => $options['header'])), '');
    $form .= mso_widget_create_form(t('Формат'), form_input(array('name' => $widget . 'format', 'value' => $options['format'])), t('Возможные подстановки: [LINK_URL]ссылка[/LINK] [LINK_PAGE]ссылка[/LINK] [NAME] [COUNT]'));
    $form .= mso_widget_create_form('Количество комментаторов', form_input(array('name' => $widget . 'commentators_cnt', 'value' => $options['commentators_cnt'])), '');
    $form .= mso_widget_create_form(t('За сколько дней учитывать комментарии'), form_input(array('name' => $widget . 'days', 'value' => $options['days'])), '');
    return $form;
}
开发者ID:Kmartynov,项目名称:cms,代码行数:27,代码来源:index.php

示例7: display_settings

 public function display_settings($data = [])
 {
     if (!ee()->subscribe_model->check()) {
         ee()->table->add_row('<h3>Error</h3>', '<div class="subtext ss_notice">Your configuration is not working, please visit the settings page and update your username/password.</div>');
         return;
     }
     $list = isset($data['list']) ? $data['list'] : false;
     $type = isset($data['type']) ? $data['type'] : false;
     $text = isset($data['text']) ? $data['text'] : false;
     $auto = isset($data['auto']) ? $data['auto'] : false;
     $field = isset($data['field']) ? $data['field'] : false;
     $groups = ee()->subscribe_model->lists();
     $options = [];
     foreach ($groups->all() as $id => $group) {
         $options[$group['id']] = $group['name'];
     }
     ee()->table->add_row('List <div class="subtext">Selet the list users will sign up to.</div>', form_dropdown('subscribe_list', $options, $list));
     ee()->table->add_row('Type of Signup <div class="subtext">
             <strong>Always</strong> - user will automatically be added to the list<br>
             <strong>Opt-In</strong> - user will need to Opt-In to be added to the list
             </div>', '<label style="padding:0 5px">Always</label>' . form_radio('subscribe_type', 'always', $type == 'always') . '<label style="padding:0 5px">Opt-In</label>' . form_radio('subscribe_type', 'opt-in', $type != 'always'));
     ee()->table->add_row('Opt-In Autocheck <div class="subtext">Autocheck Checkbox if Opt-In is selected</div>', '<label style="padding:0 5px">Enabled</label>' . form_checkbox('subscribe_auto', 'true', $auto == 'true'));
     ee()->table->add_row('Opt-In Text <div class="subtext">Displayed with Checkbox if Opt-In is selected</div>', form_input('subscribe_opt-in_text', $text));
     ee()->table->add_row('Email Field<div class="subtext">If the input field on the page is not "email" please entrer the name. (exp. the marketo form used "work_email")</div>', form_input('subscribe_field', $field));
 }
开发者ID:jjpmann,项目名称:ee-subscribe,代码行数:25,代码来源:freeform_ft.subscribe.php

示例8: _display_field

 function _display_field($name, $data)
 {
     $this->EE->load->helper('form');
     $this->EE->cp->add_to_head('<script type="text/javascript" src="' . $this->EE->config->item('theme_folder_url') . 'third_party/color_picker/jscolor.js"></script>');
     $input = form_input(array('name' => $name, 'value' => $data, 'type' => 'text', 'size' => '6', 'maxlength' => '6', 'class' => 'color {pickerFaceColor:\'#ecf1f4\', pickerBorderColor:\'#b6c0c2 #b6c0c2 #b6c0c2 #b6c0c2\'}'));
     return $input;
 }
开发者ID:noahkuhn,项目名称:ColorPicker,代码行数:7,代码来源:ft.color_picker.php

示例9: revenueForm

 function revenueForm()
 {
     $revenueForm = array();
     $this->load->model('revenue_model');
     $economic = $this->expenditure_model->exp_economic();
     $donor = $this->agreement_model->getDonor();
     $source = $this->expenditure_model->getsource_Ndese();
     $budget = $this->agreement_model->getBudget();
     //REVENUE MASTER-------------------------------------------------------------------------------------
     $revenueForm['VOUCHER_NUM'] = array(form_label('भौचर नम्बर :', 'VOUCHER_NUM'), form_input(array('name' => 'VOUCHER_NUM', 'class' => 'number')));
     $revenueForm['VOUCHER_EDATE'] = array(form_label('भौचर मिति :', 'VOUCHER_EDATE'), form_input(array('name' => 'VOUCHER_EDATE', 'class' => 'number', 'id' => 'rvoucherEdate')));
     $revenueForm['VOUCHER_NDATE'] = array(form_input(array('name' => 'VOUCHER_NDATE', 'class' => 'number', 'id' => 'rvoucherNdate')));
     $revenueForm['ACC_CODE'] = array(form_label('बुद्गेत सिर्सक ', 'ACC_CODE'), form_input(array('name' => 'ACC_CODE', 'id' => 'typeauto', 'class' => 'number')), form_input(array('name' => 'ACC_CODE', 'id' => 'autocomplete', 'width' => '500px')));
     //form_dropdown('ACC_CODE', $budget, '', 'class="dropdown"'));
     $revenueForm['CREATED_BY'] = array(form_label(' प्रतिपादन BY:', 'CREATED_BY'), form_input(array('name' => 'CREATED_BY')));
     $revenueForm['CREATED_DATE'] = array(form_label('प्रतिपादन मिति :', 'CREATED_DATE'), form_input(array('name' => 'CREATED_DATE')));
     $revenueForm['AGREEMENET_ID'] = array(form_label(' agreement id :', 'AGREEMENET_ID'), form_input(array('name' => 'AGREEMENET_ID')));
     //  REVENUE DETAIL--------------------------------------------------------------------------------------
     // $revenueForm['INFO_ID'] = array(form_label('राजस्व कोड :', 'INFO_ID'), form_input(array('name' => 'INFO_ID[]', 'class' => 'number')));
     $revenueForm['AMOUNT_EDESC'] = array(form_label('मूल्य EDESC :', 'AMOUNT_EDESC'), form_input(array('name' => 'AMOUNT_EDESC[]', 'class' => 'number')));
     $revenueForm['AMOUNT_NDESC'] = array(form_input(array('name' => 'AMOUNT_NDESC[]', 'class' => 'number')));
     $revenueForm['BANK_VOUCHER_NUM'] = array(form_label('बैंक भौचर नम्बर :', 'BANK_VOUCHER_NUM'), form_input(array('name' => 'BANK_VOUCHER_NUM[]', 'class' => 'number')));
     $revenueForm['BANK_VOUCHER_DATE'] = array(form_label('बैंक भौचर मिति :', 'BANK_VOUCHER_DATE'), form_input(array('name' => 'BANK_VOUCHER_DATE[]', 'class' => 'number')));
     $revenueForm['BANK_CODE'] = array(form_label('बैंक कोड :', 'BANK_CODE'), form_input(array('name' => 'BANK_CODE[]')));
     // $revenueForm['REVENUE_DETAIL'] = array(form_label('revenu detail :', 'REVENUE_DETAIL'), form_input(array('name' => 'REVENUE_DETAIL', 'class' => 'REVENUE_DETAIL')));
     // REVENUE DETAIL DROPDOWNS----------------------------------------------------------------------
     $revenueForm['AMOUNT'] = array(form_label('मुल्य :', 'AMOUNT'), form_input(array('name' => 'AMOUNT[]', 'class' => 'AMOUNT')));
     $revenueForm['ECONOMIC_CODE5'] = array(form_dropdown('ECONOMIC_CODE5[]', $economic, '', ' class="dropdown"', 'id="reve_economic"'));
     $revenueForm['AMOUNT_TYPE'] = array(form_dropdown('AMOUNT_TYPE[]', array('d' => 'डेबिट ', 'c' => 'क्रेडिट ')));
     $revenueForm['SOURCE_TYPE_CODE'] = array(form_dropdown('SOURCE_TYPE_CODE[]', $source, '', 'class="source"'));
     $revenueForm['DONOR_CODE'] = array(form_dropdown('DONOR_CODE[]', $donor, '', 'class="donor"'));
     $revenueForm['TRANSIT'] = array(form_dropdown('TRANSIT', array('कोलेनिका ', 'बा . ख '), '', 'class="transit"'));
     $revenueForm['SUBMIT'] = array(form_submit('SUBMIT', 'Submit'));
     return $revenueForm;
 }
开发者ID:pshreez,项目名称:PHP,代码行数:35,代码来源:revenue.php

示例10: editar

 public function editar()
 {
     if (!($this->dados['infos'] = $this->curso_model->listar($this->id))) {
         redirect('../cursos/listar');
     }
     $dadosCurso = $this->dados['infos'][0];
     $form = form_open('#', array('class' => 'niceform'));
     $form .= '<table class="cadForm">';
     $form .= '<tr>';
     $form .= '<td>';
     $form .= form_label('Nome:', '', array('for' => 'email'));
     $form .= form_input('curso_nome', $dadosCurso['curso_nome'], array('size' => 30));
     $form .= form_hidden('curso_id', $dadosCurso['curso_id']);
     $form .= form_hidden('lixeira', $dadosCurso['lixeira']);
     $form .= '</td>';
     $form .= '<td>';
     $form .= form_label('Quantidade de aulas:', '', array('for' => 'email'));
     $form .= form_input('curso_qtd_aulas', $dadosCurso['curso_qtd_aulas'], array('size' => 20));
     $form .= '</td>';
     $form .= '</tr>';
     $form .= '<tr>';
     $form .= '<td></td>';
     $form .= '<td>';
     $form .= form_submit('cadastrar', 'Enviar', 'id="submit"');
     $form .= '</td>';
     $form .= '</tr>';
     $form .= '</table>';
     $form .= form_close();
     $form .= '<span class="obs">Todos os campos são obrigatórios.</span>';
     $this->dados['form'] = $form;
     $this->load->view('editar', $this->dados);
 }
开发者ID:adrisonluz,项目名称:syschool,代码行数:32,代码来源:Cursos.php

示例11: search_form_widget_form

function search_form_widget_form($num = 1)
{
    $widget = 'search_form_widget_' . $num;
    // имя для формы и опций = виджет + номер
    // получаем опции
    $options = mso_get_option($widget, 'plugins', array());
    if (!isset($options['header'])) {
        $options['header'] = '';
    }
    if (!isset($options['text'])) {
        $options['text'] = t('Что искать?');
    }
    if (!isset($options['submit'])) {
        $options['submit'] = t('Поиск');
    }
    if (!isset($options['style_text'])) {
        $options['style_text'] = '';
    }
    if (!isset($options['style_submit'])) {
        $options['style_submit'] = '';
    }
    if (!isset($options['text_posle'])) {
        $options['text_posle'] = '';
    }
    // вывод самой формы
    $CI =& get_instance();
    $CI->load->helper('form');
    $form = mso_widget_create_form(t('Заголовок'), form_input(array('name' => $widget . 'header', 'value' => $options['header'])));
    $form .= mso_widget_create_form(t('Текст подсказки'), form_input(array('name' => $widget . 'text', 'value' => $options['text'])));
    $form .= mso_widget_create_form(t('Текст на кнопке'), form_input(array('name' => $widget . 'submit', 'value' => $options['submit'])));
    $form .= mso_widget_create_form(t('CSS-стиль текста'), form_input(array('name' => $widget . 'style_text', 'value' => $options['style_text'])));
    $form .= mso_widget_create_form(t('CSS-стиль кнопки'), form_input(array('name' => $widget . 'style_submit', 'value' => $options['style_submit'])));
    $form .= mso_widget_create_form(t('Текст внизу'), form_textarea(array('name' => $widget . 'text_posle', 'value' => $options['text_posle'], 'rows' => '3')));
    return $form;
}
开发者ID:Kmartynov,项目名称:cms,代码行数:35,代码来源:index.php

示例12: menu_child

    function menu_child($parent, $level = 1)
    {
        $query = $this->CI->db->get_where('menu_detail', array('menu_parent' => $parent))->result();
        if (!empty($query)) {
            foreach ($query as $row) {
                echo form_hidden('menuid[]', $row->id);
                ?>
			<tr>
				<td><?php 
                echo $row->menu_name;
                ?>
</td>
				<td><?php 
                if ($row->menu_type == "link") {
                    echo $row->menu_link;
                } else {
                    echo site_url() . '/' . $row->menu_link;
                }
                ?>
</td>
				<td><?php 
                echo form_input(array('value' => $row->menu_order, 'name' => 'menuorder[]', 'class' => 'form-control input-sm', 'style' => 'width:50px;'));
                ?>
</td>
				<td>
				<?php 
                echo anchor('adminmenu/deletedetail/' . $row->id, 'Delete', array('class' => 'btn btn-sm btn-danger'));
                ?>
				</td>
			</tr>
			<?php 
                $this->menu_child($row->id, $level + 1);
            }
        }
    }
开发者ID:dimasedu,项目名称:decms,代码行数:35,代码来源:decmslib.php

示例13: form_output

 /**
  * Output form input
  *
  * @param	array
  * @param	array
  * @return	string
  */
 public function form_output($data)
 {
     $options['name'] = $data['form_slug'];
     $options['id'] = $data['form_slug'];
     $options['value'] = Keywords::get_string($data['value']);
     return form_input($options);
 }
开发者ID:ramonleenders,项目名称:pyrocms,代码行数:14,代码来源:field.keywords.php

示例14: display_cell

	/**
	 * Display Cell
	 */
	function display_cell($data)
	{
		if (! isset($this->cache['displayed']))
		{
			// include matrix_text.js
			$theme_url = $this->EE->session->cache['matrix']['theme_url'];
			$this->EE->cp->add_to_foot('<script type="text/javascript" src="'.$theme_url.'scripts/matrix_date.js"></script>');

			$this->cache['displayed'] = TRUE;
		}

		$r['class'] = 'matrix-date matrix-text';

		if (preg_match('/^\d{4}-\d{2}-\d{2} \d{1,2}:\d{2} \w{2}$/', $data))
		{
			// convert human time to a unix timestamp
			$data = $this->EE->localize->convert_human_date_to_gmt($data);
		}

		// pass the default date to the JS
		$r['settings']['defaultDate'] = ($data ? $this->EE->localize->set_localized_time($data) : $this->EE->localize->set_localized_time()) * 1000;

		// get the initial input value
		$formatted_date = $data ? $this->EE->localize->set_human_time($data) : '';

		$r['data'] = form_input(array(
			'name'  => $this->cell_name,
			'value' => $formatted_date,
			'class' => 'matrix-textarea'
		));

		return $r;
	}
开发者ID:rmdort,项目名称:adiee,代码行数:36,代码来源:date.php

示例15: input

 /**
  * Creates an input
  * @param string
  * @param string
  * @param array Used to repopulate the field in case of an edit
  */
 function input($name, $label, $values = array())
 {
     if (is_array($name)) {
         $opts = $name;
         $name = $opts['name'];
         $label = $opts['label'];
         $options = $opts['options'];
         foreach (array('value', 'hint') as $v) {
             if (isset($opts[$v])) {
                 ${$v} = $opts[$v];
             }
         }
         $value = $opts['value'];
         $hint = $opts['hint'];
     }
     $html = '<div class="input">';
     $html .= "<label>{$label}</label>";
     $config = array('name' => $name, 'value' => get_form_value($name, $values), 'size' => '30');
     $html .= form_input($config);
     $html .= form_error($name);
     if (isset($hint)) {
         $html .= "<quote>{$hint}</quote>";
     }
     $html .= '</div>';
     return $html;
 }
开发者ID:boriscy,项目名称:polla,代码行数:32,代码来源:form2_helper.php


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