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


PHP form::input方法代码示例

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


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

示例1: html_element

 public function html_element()
 {
     // Import base data
     $data = $this->data;
     $input = '';
     foreach ($this->parts as $type => $val) {
         isset($data['value']) or $data['value'] = '';
         $temp = $data;
         $temp['name'] = $this->data['name'] . '[' . $type . ']';
         $offset = strlen($data['value']) == 10 ? 0 : 3;
         switch ($type) {
             case 'area_code':
                 if (strlen($data['value']) == 10) {
                     $temp['value'] = substr($data['value'], 0, 3);
                 } else {
                     $temp['value'] = '';
                 }
                 $temp['class'] = 'area_code';
                 $input .= form::input(array_merge(array('value' => $val), $temp)) . '-';
                 break;
             case 'exchange':
                 $temp['value'] = substr($data['value'], 3 - $offset, 3);
                 $temp['class'] = 'exchange';
                 $input .= form::input(array_merge(array('value' => $val), $temp)) . '-';
                 break;
             case 'last_four':
                 $temp['value'] = substr($data['value'], 6 - $offset, 4);
                 $temp['class'] = 'last_four';
                 $input .= form::input(array_merge(array('value' => $val), $temp));
                 break;
         }
     }
     return $input;
 }
开发者ID:enormego,项目名称:EightPHP,代码行数:34,代码来源:phonenumber.php

示例2: __toString

 public function __toString()
 {
     $field = $this->field_name;
     $smax = @$this->args->max;
     $smin = @$this->args->min;
     $length = @$this->args->decimal_length;
     return form::input($this->field_name, $this->field_value, 'class="SpinnerNumber" spinnermax="' . $smax . '" spinnermin="' . $smin . '" decimal_length="' . $length . '"');
 }
开发者ID:brojasmeneses,项目名称:floreriarosabel,代码行数:8,代码来源:SpinnerNumberField.php

示例3: input

 public function input($fieldKey, $fieldData, $view = 'default')
 {
     $fieldData->options = self::$value;
     if ($view == 'val') {
         return self::$value[$fieldData->value];
     } else {
         return parent::input('inputSelect', $fieldKey, $fieldData, 'input');
     }
 }
开发者ID:quanict,项目名称:parkornleather,代码行数:9,代码来源:statusorder.php

示例4: __form

 private function __form()
 {
     $form = "";
     $form .= form::open();
     $form .= form::label('filename', 'Title');
     $form .= form::input('filename', '', 'class="fullWidth"');
     $form .= form::submit('submit', 'Save', 'class="submit"');
     $form .= form::close();
     return $form;
 }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:10,代码来源:snippets.php

示例5: input

 public function input($fieldKey, $fieldData)
 {
     $fieldData->options = array('1' => '-1-');
     $items = $this->CI->Pak_Model->count($fieldData->table, $fieldData->where);
     if ($items > 0) {
         for ($i = 2; $i < $items + 2; $i++) {
             $fieldData->options[$i] = "-{$i}-";
         }
     }
     return parent::input('inputSelect', $fieldKey, $fieldData, 'input');
 }
开发者ID:quanict,项目名称:parkornleather,代码行数:11,代码来源:ordering.php

示例6: input

 public function input($fieldKey, $fieldData, $view = 'default')
 {
     $fieldData->cate_type = isset($fieldData->cate_type) ? $fieldData->cate_type : 'art';
     $items = $this->CI->Pak_Model->categoryTable($fieldData->cate_type, 0, 1, 1);
     // 		bug($items); exit;
     $fieldData->options = array('*' => '- ' . lang('No Category') . ' -');
     foreach ($items as $cate) {
         $fieldData->options[$cate[0]] = $cate[1];
     }
     return parent::input('inputSelect', $fieldKey, $fieldData, $view, false);
 }
开发者ID:quanict,项目名称:parkornleather,代码行数:11,代码来源:category.php

示例7: __paypal

 private function __paypal()
 {
     $PAYPAL_ID = ORM::factory('setting', 'PAYPAL_ID');
     if (isset($_POST['PAYPAL_ID'])) {
         $PAYPAL_ID->value = $_POST['PAYPAL_ID'];
         $PAYPAL_ID->save();
     }
     $html = form::open();
     $html .= form::label('PAYPAL_ID', 'Change paypal account');
     $html .= form::input('PAYPAL_ID', $PAYPAL_ID->value, 'class="fullWidth"');
     $html .= form::submit('submit', 'Save', 'class="submit"') . '<p>&nbsp;</p><p>&nbsp;</p>';
     $html .= form::close();
     return $html;
 }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:14,代码来源:settings.php

示例8: input

 public function input($fieldKey, $fieldData)
 {
     if (!method_exists($this->CI, 'Category_Model')) {
         $this->CI->load->model('Category_Model');
     }
     $fieldData->cate_type = isset($fieldData->cate_type) ? $fieldData->cate_type : 'art';
     $items = $this->CI->Category_Model->load_items($fieldData->cate_type);
     // 		bug($items); exit;
     $fieldData->options = array('0' => '- ' . lang('No Category') . ' -');
     foreach ($items as $cate) {
         $fieldData->options[$cate[0]] = $cate[1];
     }
     return parent::input('inputSelect', $fieldKey, $fieldData);
 }
开发者ID:quanict,项目名称:parkornleather,代码行数:14,代码来源:inputCategory.php

示例9: parse_array

function parse_array($arr)
{
    foreach ($arr as $key => $value) {
        $db = DB::select()->from('categories')->where('id', '=', $key)->execute();
        echo '<ul><li>';
        echo '<b>Название:</b> ' . form::input('name[]', $db[0]['name'], array('onkeyup' => 'translit(\'name[]\', \'url[]\');')) . form::hidden('cid[]', $db[0]['id']) . '&nbsp;';
        echo '<b>URL:</b> ' . form::input('url[]', $db[0]['url']) . '&nbsp;';
        echo '<b>Удалить?</b> ' . form::checkbox('delete[]', $db[0]['id']);
        echo '</li>';
        if (is_array($value)) {
            parse_array($value);
        }
        echo '</ul>';
    }
}
开发者ID:phpdude,项目名称:Purpled-Blog-Engine,代码行数:15,代码来源:categories.php

示例10: html_element

 protected function html_element()
 {
     // Import the data
     $data = $this->data;
     if (empty($data['checked'])) {
         // Not checked
         unset($data['checked']);
     } else {
         // Is checked
         $data['checked'] = 'checked';
     }
     if ($label = arr::remove('label', $data)) {
         // There must be one space before the text
         $label = ' ' . ltrim($label);
     }
     return '<label>' . form::input($data) . $label . '</label>';
 }
开发者ID:Juuro,项目名称:Dreamapp-Website,代码行数:17,代码来源:Form_Checkbox.php

示例11: _generate_body_cell

		protected function _generate_body_cell($index, $key)
		{
			// variables
				$body	= $this->body_data;
				$value	= $body[$index][$key];
				$name	= $this->post_id . '[' .$body[$index][$this->data_id]. '][' .$key. ']';
				
			// data
				$type	= $this->default_type;
				$data	= NULL;
				if(array_key_exists($key, $this->control_types))
				{
					$type	= $this->control_types[$key][0];
					$data	= $this->control_types[$key][1];
				}
			
			// html
				$str	= '';
				switch($type)
				{
					case 'text':
						$str = form::input($name, $value);
						break;
						
					case 'dropdown':
						$str = form::dropdown($name, $data, $value);
						break;
						
					case 'radio':
					case 'checkbox':
						foreach($data as $d)
						{
							$str .= form::$type($name, $d, $value == $d, 'style="width:auto"') . ' ' . ucwords($d) . ' ';
							if($type == 'checkbox')
							{
								$str .= '<br />';
							}
						}
						break;
						
					default:
						$str = $value;
				}
				
				return '<td>' . $str . '</td>';
		}
开发者ID:nevermlnd,项目名称:cv,代码行数:46,代码来源:table.php

示例12: _form

    public function _form($user)
    {
        $html = "";
        $html .= form::open(null, array('class' => 'valid_form'));
        $html .= form::input(array('email', 'Email'), $user->email, 'class="fullWidth required email"');
        $html .= form::label('New Password');
        $html .= form::password('password[]', '', 'class="fullWidth"');
        $html .= form::label('Repeat Password');
        $html .= form::password('password[]', '', 'class="fullWidth"');
        $html .= "<hr/>";
        $html .= form::label('openid', 'OpenID <img src="http://www.plaxo.com/images/openid/login-bg.gif" />');
        $html .= '<p><small><a href="http://www.openid.net" target="_BLANK">What is an OpenID?</a></small></p>
			<p><small>Please remember the "http://"</small></p>';
        $html .= form::input('openid', $user->openid, 'class="fullWidth url"');
        $html .= form::submit('submit', 'Save', 'class="submit"');
        $html .= form::close();
        return $html;
    }
开发者ID:sydlawrence,项目名称:SocialFeed,代码行数:18,代码来源:profile.php

示例13: input

 public function input($fieldKey, $fieldData)
 {
     $fieldData->options = array();
     foreach (self::$opt as $k => $alias) {
         $title = str_replace('-', ' & ', $alias);
         $title = str_replace('+', ' ', $title);
         $fieldData->options[$k] = ucwords($title);
     }
     //		$fieldData->options = array(
     //				1=>lang('Crocodile'),
     //				2=>lang('Stingray'),
     //				12=>lang('Crocodie & Stingray'),
     //				3=>lang('Snake'),
     //				23=>lang('Stingray & Snake'),
     //				4=>lang('Ostrich'),
     //				5=>lang('Buffalo'),
     //				6=>lang('Cow'),
     //		);
     return parent::input('inputSelect', $fieldKey, $fieldData);
 }
开发者ID:quanict,项目名称:parkornleather,代码行数:20,代码来源:leather.php

示例14: login

 public function login()
 {
     if ($this->a2->logged_in()) {
         //cannot create new accounts when a user is logged in
         return $this->index();
     }
     $post = Validation::factory($_POST)->pre_filter('trim')->add_rules('username', 'required', 'length[4,127]')->add_rules('password', 'required');
     if ($post->validate()) {
         if ($this->a1->login($post['username'], $post['password'])) {
             // login succesful
             url::redirect('a2demo/index');
         }
     }
     //show form
     echo form::open();
     echo 'username:' . form::input('username') . '<br>';
     echo 'password:' . form::password('password') . '<br>';
     echo form::submit(array('value' => 'login'));
     echo form::close();
 }
开发者ID:BlakeLucchesi,项目名称:kohanamodules2.3.2,代码行数:20,代码来源:a2demo.php

示例15: action_login

 public function action_login()
 {
     if ($this->user) {
         //cannot create new accounts when a user is logged in
         return $this->action_index();
     }
     $post = Validate::factory($_POST)->filter(TRUE, 'trim')->rule('username', 'not_empty')->rule('username', 'min_length', array(4))->rule('username', 'max_length', array(127))->rule('password', 'not_empty');
     if ($post->check()) {
         if ($this->a1->login($post['username'], $post['password'], isset($_POST['remember']) ? (bool) $_POST['remember'] : FALSE)) {
             $this->request->redirect('a2demo/index');
         }
     }
     //show form
     echo form::open();
     echo 'username:' . form::input('username') . '<br>';
     echo 'password:' . form::password('password') . '<br>';
     echo 'remember me:' . form::checkbox('remember', TRUE) . '<br>';
     echo form::submit('login', 'login');
     echo form::close();
     echo Kohana::debug($post->errors());
 }
开发者ID:sars,项目名称:rp,代码行数:21,代码来源:a2demo.php


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