本文整理汇总了PHP中FORM::hidden方法的典型用法代码示例。如果您正苦于以下问题:PHP FORM::hidden方法的具体用法?PHP FORM::hidden怎么用?PHP FORM::hidden使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类FORM
的用法示例。
在下文中一共展示了FORM::hidden方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cf_form_tag
/**
* get the html tag code for a field for a custom field
* @param string $name input name
* @param array $options as defined
* @param mixed $value value of the field, optional.
* @param boolean $old =TRUE renders bs2 styles
* @param boolean $inline renders inline form
* @return string HTML
*/
public static function cf_form_tag($name, $options, $value = NULL, $old = FALSE, $inline = FALSE)
{
if ($options['display'] != 'hidden') {
$label = FORM::label($name, isset($options['label']) ? $options['label'] : $name, array('class' => !$old ? 'control-label' : '', 'for' => $name));
} else {
$label = '';
}
if ($value === NULL) {
$value = isset($options['default']) ? $options['default'] : NULL;
}
// dependent classes on type
$class = 'form-control ' . 'cf_' . $options['display'] . '_fields data-custom ';
switch ($options['display']) {
case 'textarea':
$class .= 'span6';
break;
case 'checkbox':
$class = 'cf_' . $options['display'] . '_fields data-custom';
break;
case 'radio':
$class = 'cf_' . $options['display'] . 'fields data-custom';
$required = (isset($options['required']) and $options['required'] == TRUE) ? 'required' : NULL;
$data_categories = isset($options['categories']) ? json_encode($options['categories']) : NULL;
$title = isset($options['tooltip']) ? $options['tooltip'] : NULL;
break;
default:
$class .= " ";
break;
}
$attributes = array('placeholder' => isset($options['label']) ? $options['label'] : $name, 'data-placeholder' => isset($options['label']) ? $options['label'] : $name, 'title' => isset($options['tooltip']) ? $options['tooltip'] : NULL, 'data-categories' => isset($options['categories']) ? json_encode($options['categories']) : NULL, 'class' => $class, 'id' => $name, (isset($options['required']) and $options['required'] == TRUE) ? 'required' : NULL);
switch ($options['display']) {
case 'select':
$input = FORM::select($name, $options['options'], !is_array($value) ? $value : NULL, $attributes);
break;
case 'text':
$input = FORM::input($name, $value, $attributes);
break;
case 'textarea':
$input = FORM::textarea($name, $value, $attributes);
break;
case 'hidden':
$input = FORM::hidden($name, $value, $attributes);
break;
case 'datetime':
$attributes['data-datetime'] = "data-datetime";
$attributes['data-format'] = "yyyy-MM-dd hh:mm";
$input = FORM::input($name, $value, $attributes);
break;
case 'date':
$attributes['data-date'] = "data-date";
$attributes['data-date-format'] = "yyyy-mm-dd";
$input = FORM::input($name, $value, $attributes);
break;
case 'checkbox':
$checked = $value == 1 ? TRUE : FALSE;
$input = '';
$label = '<b>' . $options['label'] . '</b>';
$input .= '<div class="checkbox"><label>' . $value . FORM::hidden($name, 0) . FORM::checkbox($name, NULL, $checked, $attributes) . '</label></div>';
break;
case 'radio':
$input = '';
$label = '<b>' . $options['label'] . '</b>';
$index = 0;
foreach ($options['options'] as $id => $radio_name) {
$checked = $value == $index ? TRUE : FALSE;
if ($id !== "") {
$input .= '<div class="radio"><label>' . $radio_name . Form::radio($name, $index, $checked, $attributes) . '</label></div>';
}
$index++;
}
break;
case 'string':
default:
$input = FORM::input($name, $value, $attributes);
break;
}
if (!$old) {
!$inline ? $is_inline = "class='col-md-5 col-sm-8 col-xs-11'" : ($is_inline = "");
$out = '<div ' . $is_inline . '>' . $label . $input . '</div>';
} else {
$out = $label . '<div>' . $input . '</div>';
}
return $out;
}
示例2: defined
<?php
defined('SYSPATH') or die('No direct script access.');
echo FORM::open('search', array('method' => 'get', 'class' => 'search-form'));
?>
<?php
echo FORM::input('str', Arr::get($values, 'str'));
?>
<?php
echo FORM::hidden('search_type', Arr::get($values, 'search_type'));
?>
<button name="submit" class="submit">Искать <span class="search-preloader"><img src="/assets/img/search_button_preloader.gif" alt="Искать" /></span></button>
<div class="tip">Запросы можно вводить через запятую, например Москва, Ауди, Тюнинг</div>
<div class="form-errors">
<?php
foreach ($errors as $error) {
echo '<div class="error">' . $error . '</div>';
}
?>
</div>
<div class="result">
<?php
echo $result;
?>
</div>
<?php
echo FORM::close();
示例3: defined
<?php
defined('SYSPATH') or die('No direct script access.');
?>
<form id="fileupload" action="/rest/companyimage" method="POST" enctype="multipart/form-data">
<?php
echo FORM::hidden('company_id', $service->id);
?>
<div class="fileupload-buttonbar">
<a class="btn btn-success fileinput-button">
<i class="icon-plus icon-white"></i>
<span>Добавить изображение</span>
<input type="file" name="files[]" multiple>
</a>
<button type="submit" class="btn btn-primary start">
<i class="icon-upload icon-white"></i>
Загрузить
</button>
<button type="reset" class="btn btn-warning cancel">Отмена</button>
</div>
<table role="presentation" class="table table-striped">
<thead>
<tr>
<th>Превью</th>
<th></th>
<th>Заголовок</th>
<th>Операции</th>
</tr>
</thead>
示例4: __
<form action="<?php
echo URL::base();
echo Request::current()->uri();
?>
" method="post">
<div class="panel panel-default">
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<?php
echo FORM::label('css_active', __('Switch off custom CSS'), array('class' => 'control-label col-sm-4', 'for' => 'css_active'));
?>
<div class="col-sm-8">
<div class="onoffswitch">
<?php
echo FORM::hidden('css_active', 0);
?>
<?php
echo FORM::checkbox('css_active', 1, (bool) $css_active, array('placeholder' => "", 'class' => 'onoffswitch-checkbox', 'id' => 'css_active', 'data-original-title' => __("Switch off custom CSS"), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-content' => __("Require only the logged in users to post.")));
?>
<?php
echo FORM::label('css_active', "<span class='onoffswitch-inner'></span><span class='onoffswitch-switch'></span>", array('class' => 'onoffswitch-label', 'for' => 'css_active'));
?>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4"><?php
echo __('CSS');
?>
示例5: __
</div>
<div class="form-group">
<?php
echo FORM::label($forms['adblock']['id'], __('Adblock Detection'), array('class' => 'control-label col-sm-4', 'for' => $forms['adblock']['id']));
?>
<div class="col-sm-8">
<div class="onoffswitch">
<?php
echo Form::checkbox($forms['adblock']['key'], 1, (bool) $forms['adblock']['value'], array('placeholder' => __("TRUE or FALSE"), 'class' => 'onoffswitch-checkbox', 'id' => $forms['adblock']['id'], 'data-content' => __("Once set to TRUE, enables adblock detection"), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-original-title' => __("Adblock Detection")));
?>
<?php
echo FORM::label($forms['adblock']['id'], "<span class='onoffswitch-inner'></span><span class='onoffswitch-switch'></span>", array('class' => 'onoffswitch-label', 'for' => $forms['adblock']['id']));
?>
<?php
echo FORM::hidden($forms['adblock']['key'], 0);
?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
<div class="col-sm-8 col-sm-offset-4">
<?php
echo FORM::button('submit', __('Save'), array('type' => 'submit', 'class' => 'btn btn-primary', 'action' => Route::url('oc-panel', array('controller' => 'settings', 'action' => 'general'))));
?>
</div>
示例6: __
" method="post">
<div class="panel panel-default">
<div class="panel-heading"><h3 class="panel-title"><?php
echo __('General Configuration');
?>
</h3></div>
<div class="panel-body">
<div class="form-horizontal" id="default-settings">
<div class="form-group">
<?php
echo FORM::label('map_active', __('Map on homepage'), array('class' => 'control-label col-sm-4', 'for' => 'map_active'));
?>
<div class="col-sm-8">
<div class="onoffswitch">
<?php
echo FORM::hidden('map_active', 0);
?>
<?php
echo FORM::checkbox('map_active', 1, (bool) $map_active, array('placeholder' => "", 'class' => 'onoffswitch-checkbox', 'id' => 'map_active', 'data-original-title' => __("Map on homepage"), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-content' => __("Disables generated map on homepage")));
?>
<?php
echo FORM::label('map_active', "<span class='onoffswitch-inner'></span><span class='onoffswitch-switch'></span>", array('class' => 'onoffswitch-label', 'for' => 'map_active'));
?>
</div>
</div>
</div>
<div class="form-group">
<label class="control-label col-sm-4" for="bg_color">
<?php
echo __('Background Color');
?>
示例7: __
<div class="form-group">
<?php
echo FORM::label('seotitle', __('Seotitle'), array('class' => 'control-label col-md-2', 'for' => 'seotitle'));
?>
<div class="col-sm-4">
<?php
echo FORM::input('seotitle', '', array('placeholder' => __('seotitle'), 'class' => 'form-control', 'id' => 'seotitle'));
?>
</div>
</div>
<div class="form-group">
<div class="col-sm-4">
<?php
echo FORM::hidden('type', $type, array('placeholder' => __('Type'), 'class' => 'form-control', 'id' => 'type'));
?>
</div>
</div>
<div class="form-group">
<div class="col-sm-offset-2 col-sm-10">
<div class="checkbox">
<label class="status">
<input type="checkbox" name="status"> <?php
echo __('Active');
?>
</label>
</div>
</div>
</div>
<div class="form-group">
示例8: array
<div class="control-group">
<label class="control-label">Вступ. взнос</label>
<div class="controls">
<?php
echo FORM::select('entrance_fee', array('Y' => 'Да', 'N' => 'Нет'), Arr::get($values, 'entrance_fee', 'N'));
?>
<p class="help-block" style="color: red;"><?php
echo Arr::get($errors, 'entrance_fee');
?>
</p>
</div>
</div>
<div class="form-actions">
<?php
echo FORM::hidden('id', Arr::get($values, 'id'));
?>
<?php
echo FORM::submit(NULL, 'Сохранить', array('class' => 'btn btn-success btn-large'));
?>
</div>
</fieldset>
<?php
echo FORM::close();
?>
示例9: __
<div class="panel panel-default">
<div class="panel-heading"><?php
echo __("Amazon S3 Configuration");
?>
</div>
<div class="panel-body">
<div class="form-horizontal">
<div class="form-group">
<?php
echo FORM::label($forms_img['aws_s3_active']['key'], __('Amazon S3 active'), array('class' => 'control-label col-sm-4', 'for' => $forms_img['aws_s3_active']['key']));
?>
<div class="col-sm-8">
<div class="onoffswitch">
<?php
echo FORM::hidden($forms_img['aws_s3_active']['key'], 0);
?>
<?php
echo Form::checkbox($forms_img['aws_s3_active']['key'], 1, (bool) $forms_img['aws_s3_active']['value'], array('placeholder' => __("TRUE or FALSE"), 'class' => 'onoffswitch-checkbox', 'id' => $forms_img['aws_s3_active']['key'], 'data-content' => __('Amazon S3 active'), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-original-title' => ''));
?>
<?php
echo FORM::label($forms_img['aws_s3_active']['key'], "<span class='onoffswitch-inner'></span><span class='onoffswitch-switch'></span>", array('class' => 'onoffswitch-label', 'for' => $forms_img['aws_s3_active']['key']));
?>
</div>
</div>
</div>
<div class="form-group">
<?php
echo FORM::label($forms_img['aws_access_key']['key'], __('AWS Access Key'), array('class' => 'control-label col-sm-4', 'for' => $forms_img['aws_access_key']['key']));
?>
示例10: cf_form_field
/**
* get field html code for a custom field
* @param string $name input name
* @param array $options as defined
* @param mixed $value value of the field, optional.
* @return string HTML
*/
public static function cf_form_field($name, $options, $value = NULL)
{
if ($value === NULL) {
$value = isset($options['default']) ? $options['default'] : NULL;
}
// dependent classes on type
$class = 'form-control ' . 'cf_' . $options['display'] . '_fields data-custom ';
switch ($options['display']) {
case 'checkbox':
$class = 'cf_' . $options['display'] . '_fields data-custom';
break;
case 'radio':
$class = 'cf_' . $options['display'] . 'fields data-custom';
$required = (isset($options['required']) and $options['required'] == TRUE) ? 'required' : NULL;
$data_categories = isset($options['categories']) ? json_encode($options['categories']) : NULL;
$title = isset($options['tooltip']) ? $options['tooltip'] : NULL;
break;
default:
$class .= " ";
break;
}
$attributes = array('placeholder' => isset($options['placeholder']) ? $options['placeholder'] : (isset($options['label']) ? $options['label'] : $name), 'data-placeholder' => isset($options['data-placeholder']) ? $options['data-placeholder'] : (isset($options['label']) ? $options['label'] : $name), 'title' => isset($options['tooltip']) ? $options['tooltip'] : NULL, 'data-categories' => isset($options['categories']) ? json_encode($options['categories']) : NULL, 'class' => $class, 'id' => $name, (isset($options['required']) and $options['required'] == TRUE) ? 'required' : NULL);
switch ($options['display']) {
case 'select':
$input = FORM::select($name, $options['options'], !is_array($value) ? $value : NULL, $attributes);
break;
case 'text':
$input = FORM::input($name, $value, $attributes);
break;
case 'textarea':
$input = FORM::textarea($name, $value, $attributes);
break;
case 'hidden':
$input = FORM::hidden($name, $value, $attributes);
break;
case 'date':
$attributes['data-date'] = "data-date";
$attributes['data-date-format'] = "yyyy-mm-dd";
$input = FORM::input($name, $value, $attributes);
break;
case 'checkbox':
$checked = isset($value);
// value can be 1 or 'on'
$input = '<div class="checkbox"><label>' . FORM::checkbox($name, NULL, $checked, $attributes) . '</label></div>';
break;
case 'radio':
$input = '';
$index = 0;
foreach ($options['options'] as $id => $radio_name) {
$checked = $value == $index ? TRUE : FALSE;
if ($id !== "") {
$input .= '<div class="radio"><label>' . Form::radio($name, $index, $checked, $attributes) . ' ' . $radio_name . '</label></div>';
}
$index++;
}
break;
case 'email':
$attributes['type'] = 'email';
$input = FORM::input($name, $value, $attributes);
break;
case 'string':
default:
$input = FORM::input($name, $value, $attributes);
break;
}
return $input;
}
示例11: array
echo FORM::input('address', Arr::get($values, 'address'), array('class' => 's_inp', 'id' => 'address', 'style' => $address_inp_style));
?>
<div class="form_error"><?php
echo Message::show_once_error($errors, 'address');
?>
</div>
</div>
<div class='field_body'>
<label class="lab"><?php
echo __('f_map_location');
?>
</label>
<div id="edit-map"></div>
<div class="map-error"></div>
<?php
echo FORM::hidden('ymap_lat', Arr::get($values, 'ymap_lat')) . FORM::hidden('ymap_lng', Arr::get($values, 'ymap_lng'));
?>
</div>
<div class='field_body'>
<label for="phone" class="lab"><?php
echo __('f_phone');
?>
</label>
+7 <?php
echo FORM::input('code', Arr::get($values, 'code'), array('class' => 's_inp', 'style' => 'width: 40px;'));
?>
<?php
echo FORM::input('phone', Arr::get($values, 'phone'), array('class' => 's_inp', 'id' => 'phone', 'style' => $phone_inp_style . ' width: 267px;'));
?>
<div class="form_error"><?php
echo Message::show_once_error($errors, 'code');
示例12: array
echo FORM::checkbox('captcha', 1, (bool) core::config('advertisement.captcha'), array('placeholder' => "http://foo.com/", 'class' => 'onoffswitch-checkbox', 'id' => 'captcha', 'data-content' => __("Enables Captcha"), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-original-title' => __("Captcha appears in the form.")));
?>
<?php
echo FORM::label('captcha', "<span class='onoffswitch-inner'></span><span class='onoffswitch-switch'></span>", array('class' => 'onoffswitch-label', 'for' => 'captcha'));
?>
</div>
</div>
</div>
<div class="form-group">
<?php
echo FORM::label('address', __('Address'), array('class' => 'control-label col-sm-4', 'for' => 'address'));
?>
<div class="col-sm-8">
<div class="onoffswitch">
<?php
echo FORM::hidden('address', 0);
?>
<?php
echo FORM::checkbox('address', 1, (bool) core::config('advertisement.address'), array('placeholder' => "", 'class' => 'onoffswitch-checkbox', 'id' => 'address', 'data-content' => __("Address field"), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-original-title' => __("Displays the field Address in the Ad form.")));
?>
<?php
echo FORM::label('address', "<span class='onoffswitch-inner'></span><span class='onoffswitch-switch'></span>", array('class' => 'onoffswitch-label', 'for' => 'address'));
?>
</div>
</div>
</div>
<hr>
<div class="form-group">
<div class="col-sm-8 col-sm-offset-4">
<?php
echo FORM::button('submit', __('Save'), array('type' => 'submit', 'class' => 'btn btn-primary', 'action' => Route::url('oc-panel', array('controller' => 'settings', 'action' => 'form')) . '?define=cf'));
示例13: array
<div class="col-md-8">
<?php
echo FORM::input($forms['stripe_public']['key'], $forms['stripe_public']['value'], array('placeholder' => "", 'class' => 'tips form-control', 'id' => $forms['stripe_public']['key'], 'data-content' => __("Stripe public key"), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-original-title' => ''));
?>
</div>
</div>
<div class="form-group">
<?php
echo FORM::label($forms['stripe_address']['key'], __('Requires address to pay for extra security'), array('class' => 'col-md-4 control-label', 'for' => $forms['stripe_address']['key']));
?>
<div class="col-md-8">
<div class="onoffswitch">
<?php
echo FORM::hidden($forms['stripe_address']['key'], 0);
?>
<?php
echo FORM::checkbox($forms['stripe_address']['key'], 1, (bool) $forms['stripe_address']['value'], array('placeholder' => "TRUE or FALSE", 'class' => 'onoffswitch-checkbox', 'id' => $forms['stripe_address']['key'], 'data-content' => '', 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-original-title' => ''));
?>
<?php
echo FORM::label($forms['stripe_address']['key'], "<span class='onoffswitch-inner'></span><span class='onoffswitch-switch'></span>", array('class' => 'onoffswitch-label', 'for' => $forms['stripe_address']['key']));
?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
示例14: array
echo FORM::checkbox($forms['number_of_orders']['key'], 1, (bool) $forms['number_of_orders']['value'], array('placeholder' => "TRUE or FALSE", 'class' => 'onoffswitch-checkbox', 'id' => $forms['number_of_orders']['key'], 'data-content' => __("Enables users to review purchased products"), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-original-title' => __("Number of sales")));
?>
<?php
echo FORM::label($forms['number_of_orders']['key'], "<span class='onoffswitch-inner'></span><span class='onoffswitch-switch'></span>", array('class' => 'onoffswitch-label', 'for' => $forms['number_of_orders']['key']));
?>
</div>
</div>
</div>
<div class="form-group">
<?php
echo FORM::label($forms['qr_code']['key'], __("Show QR code"), array('class' => 'col-md-4 control-label', 'for' => $forms['qr_code']['key']));
?>
<div class="col-md-8">
<div class="onoffswitch">
<?php
echo FORM::hidden($forms['qr_code']['key'], 0);
?>
<?php
echo FORM::checkbox($forms['qr_code']['key'], 1, (bool) $forms['qr_code']['value'], array('placeholder' => "TRUE or FALSE", 'class' => 'onoffswitch-checkbox', 'id' => $forms['qr_code']['key'], 'data-content' => __("Show QR code in Product"), 'data-trigger' => "hover", 'data-placement' => "right", 'data-toggle' => "popover", 'data-original-title' => __("Show QR code")));
?>
<?php
echo FORM::label($forms['qr_code']['key'], "<span class='onoffswitch-inner'></span><span class='onoffswitch-switch'></span>", array('class' => 'onoffswitch-label', 'for' => $forms['qr_code']['key']));
?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="panel panel-default">
<div class="panel-body">
示例15: array
</div>
<div id="middle_road">
<div class="logo">
<?php
echo HTML::anchor('/', HTML::image('assets/img/logo.png', array('alt' => 'На главную', 'title' => 'На главную', 'class' => 'logo_img')));
?>
</div>
<div class="sub_menu">
<div class="sub-menu-form">
<ul>
<li>
<?php
echo FORM::open('search', array('method' => 'get'));
?>
<?php
echo FORM::input('str', NULL, array('placeholder' => 'поисковый запрос', 'class' => 'search_input')) . FORM::hidden('search_type', 'all');
?>
<?php
echo FORM::submit(NULL, 'Найти', array('class' => 'search_submit'));
?>
<?php
echo FORM::close();
?>
</li>
</ul>
</div>
</div>
<div class="menu">
<ul>
<li><?php
echo HTML::anchor('participants', 'УЧАСТНИКИ', array('class' => 'menu-auto-filter'));