本文整理汇总了PHP中form::label方法的典型用法代码示例。如果您正苦于以下问题:PHP form::label方法的具体用法?PHP form::label怎么用?PHP form::label使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类form
的用法示例。
在下文中一共展示了form::label方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: label
public function label($name)
{
$field = $this->_meta->fields($name);
if ($field) {
return form::label('field-' . $name, $field->label);
}
return ucfirst($name);
}
示例2: buildForm
private function buildForm()
{
$options = array('method' => "POST", 'enctype' => "multipart/form-data", 'action' => '/blog/formular/add', 'width' => '400px');
$form = new \form('testing', $options);
$form->label('checkbox');
$form->checkbox('checkbox test', 'testcheckbox', 'check', '');
$form->checkbox('checkbox test2', 'testcheckbox', 'check2', true);
$form->label('radio');
$form->radio('radio test', 'testradio', 'radio', '');
$form->radio('radio test 2', 'testradio', 'radio2', true);
$form->label('textarea');
$form->text('textarea', ' ', ['error' => $this->error['textarea']]);
$form->select('autos', ['a' => 'audi', 'b' => 'vw', 'c' => 'toyota'], 'b', ['label' => 'auto select']);
$form->text('username', '', ['placeholder' => 'username', 'label' => 'Username', 'error' => $this->error['username']]);
$form->password('password', '', ['label' => 'Password', 'error' => $this->error['password']]);
$form->button('senden', ['type' => 'submit']);
return $form;
}
示例3: edit
public function edit($url)
{
$display_name = ucwords(str_replace('_', ' ', $url));
$this->__set_heading("Editing Theme file - " . $display_name);
$view = new View('zest/content');
$content = form::open('admin/snippets/save/' . $url);
$html = zest::template_to_html(THEME_PATH . $url);
$content .= form::label('content', 'Code');
$content .= '<p><small>This is only for advanced users. To edit <a onclick="$(\'#content\').toggle();return false;" href="#">click here</a></small></p>';
$content .= form::textarea('content', $html, 'id="content" class="fullWidth no-editor hside"');
$content .= form::submit('submit', 'Save', 'class="submit"');
$content .= form::close();
$view->content = $content;
$this->__set_content($view);
}
示例4: __under_development
private function __under_development()
{
$UNDER_DEVELOPMENT = ORM::factory('setting', 'UNDER_DEVELOPMENT');
if (isset($_POST['UNDER_DEVELOPMENT'])) {
$UNDER_DEVELOPMENT->value = $_POST['UNDER_DEVELOPMENT'];
$UNDER_DEVELOPMENT->save();
}
$data = array("name" => "UNDER_DEVELOPMENT", "class" => "fullWidth");
$options = array(null => "YES", "1" => "NO");
$selected = $UNDER_DEVELOPMENT->value;
$html = form::open();
$html .= form::label('UNDER_DEVELOPMENT', 'Under Development');
$html .= form::dropdown($data, $options, $selected);
$html .= form::submit('submit', 'Save', 'class="submit"') . '<p> </p><p> </p>';
$html .= form::close();
return $html;
}
示例5: _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;
}
示例6: array
<h2><?php
echo Kohana::lang('user.login');
?>
</h2>
<? base::success($success); ?>
<? base::errors($errors); ?>
<?
echo form::open(NULL, array('class' => 'glForms'));
echo form::label('email', kohana::lang('user.email'));
echo form::input('email', ($form['email']));
echo '<br />';
echo form::label('password', Kohana::lang('user.password'));
echo form::password('password', NULL);
echo '<br />';
echo form::label('submit', ' ');
echo form::submit('submit', Kohana::lang('user.logmein'),'class=button');
echo '<br />';
echo form::close();
?>
<p><a href="/user/register"><?php
echo Kohana::lang('user.register');
?>
</a> | <a href="/user/password"><?php
echo Kohana::lang('user.forgot_password');
?>
</a> | <a href="/user/renew"><?php
echo Kohana::lang('user.renew_password');
?>
</a></p>
示例7: foreach
$html .= "<tr>";
}
$html .= "<td>";
$set_default = FALSE;
if (!empty($multi_defaults)) {
foreach ($multi_defaults as $key => $def) {
$set_default = trim($option) == trim($def);
if ($set_default) {
break;
}
}
}
$option = trim($option);
$html .= "<span class=\"custom-field-option\">";
$html .= form::checkbox("custom_field[" . $field_id . '-' . $cnt . ']', $option, $set_default, $id_name);
$html .= form::label("custom_field[" . $field_id . ']', " " . $option);
$html .= "</span>";
$html .= "</td>";
if ($cnt % 2 == 1 or $cnt == count($options) - 1) {
$html .= "</tr>";
}
$cnt++;
}
// XXX Hack to deal with required checkboxes that are submitted with nothing checked
$html .= "</table>";
$html .= form::hidden("custom_field[" . $field_id . "-BLANKHACK]", '', $id_name);
break;
case 7:
$ddoptions = array();
// Semi-hack to deal with dropdown boxes receiving a range like 0-100
if (preg_match("/[0-9]+-[0-9]+/", $defaults[0]) and count($options == 1)) {
示例8: label
/**
* Sets or returns the input label.
*
* @chainable
* @param string label to set
* @return string|object
*/
public function label($val = NULL)
{
if ($val === NULL) {
if (isset($this->data['name']) and isset($this->data['label'])) {
return form::label($this->data['name'], $this->data['label']);
}
return FALSE;
} else {
$this->data['label'] = $val === TRUE ? utf8::ucwords(inflector::humanize($this->name)) : $val;
return $this;
}
}
示例9:
?>
" alt="<?php
Kohana::lang('settings.site.banner');
?>
" /><br/>
<?php
}
?>
<?php
echo form::upload('banner_image', '', '');
?>
(<= 250k)
<br/>
<?php
echo form::checkbox('delete_banner_image', '1');
echo form::label('delete_banner_image', Kohana::lang("settings.site.delete_banner_image"));
?>
</div>
<div class="row">
<h4><a href="#" class="tooltip" title="<?php
echo Kohana::lang("tooltips.settings_site_email");
?>
"><?php
echo Kohana::lang('settings.site.email_site');
?>
</a>
<br /><?php
echo Kohana::lang('settings.site.email_notice');
?>
</h4>
<?php
示例10: form
/**
* Demonstrates how to use the form helper with the Validation libraryfor file uploads .
*/
function form()
{
// Anything submitted?
if ($_POST) {
// Merge the globals into our validation object.
$post = Validation::factory(array_merge($_POST, $_FILES));
// Ensure upload helper is correctly configured, config/upload.php contains default entries.
// Uploads can be required or optional, but should be valid
$post->add_rules('imageup1', 'upload::required', 'upload::valid', 'upload::type[gif,jpg,png]', 'upload::size[1M]');
$post->add_rules('imageup2', 'upload::required', 'upload::valid', 'upload::type[gif,jpg,png]', 'upload::size[1M]');
// Alternative syntax for multiple file upload validation rules
//$post->add_rules('imageup.*', 'upload::required', 'upload::valid', 'upload::type[gif,jpg,png]', 'upload::size[1M]');
if ($post->validate()) {
// It worked!
// Move (and rename) the files from php upload folder to configured application folder
upload::save('imageup1');
upload::save('imageup2');
echo 'Validation successfull, check your upload folder!';
} else {
// You got validation errors
echo '<p>validation errors: ' . var_export($post->errors(), TRUE) . '</p>';
echo Kohana::debug($post);
}
}
// Display the form
echo form::open('examples/form', array('enctype' => 'multipart/form-data'));
echo form::label('imageup', 'Image Uploads') . ':<br/>';
// Use discrete upload fields
// Alternative syntax for multiple file uploads
// echo form::upload('imageup[]').'<br/>';
echo form::upload('imageup1') . '<br/>';
echo form::upload('imageup2') . '<br/>';
echo form::submit('upload', 'Upload!');
echo form::close();
}
示例11: empty
?>
<?php
echo empty($title->error) ? form::input($title->name, $title->value) : form::input($title->name, $title->value, 'class="error"');
?>
<?php
if (!empty($title->error)) {
?>
<br /><span class="error"><?php
echo $title->error;
?>
</span><?php
}
?>
</p>
<p><?php
echo form::label($blog_content->name, $blog_content->label) . form::textarea($blog_content->name, $blog_content->value);
?>
</p>
<p><?php
echo form::label($tags->name, $tags->label) . form::input($tags->name, $tags->value);
?>
</p>
</div>
</div>
<p><?php
echo form::submit($submit->name, $submit->label);
?>
</p>
<?php
echo form::close();
示例12:
<div class="form-fields">
<?php
echo form::label('shipping[state]', 'State');
?>
<?php
echo form::input('shipping[state]');
?>
</div>
<div class="form-fields">
<?php
echo form::label('shipping[postal_code]', 'Zip/Postal Code');
?>
<?php
echo form::input('shipping[postal_code]');
?>
</div>
<div class="form-fields">
<?php
echo form::label('shipping[country]', 'Country');
?>
<?php
echo form::input('shipping[country]');
?>
</div>
</fieldset>
<div class="clear"></div>
<?php
echo form::submit('submit_billing', 'Continue to Order Review');
echo form::close();
示例13:
echo form::dropdown('vendor_id', ORM::factory('vendor')->select_list('id', 'name'), $product->vendor);
?>
</div>
<div class="form-fields" id="categories">
<?php
echo form::label('categories', 'Categories');
?>
<?php
echo form::many_to_many($product, ORM::factory('category')->find_all(), 'categories', 'name', 'table');
?>
</div>
<div class="form-fields">
<?php
echo form::label('options', 'Options');
?>
<?php
echo form::many_to_many($product, ORM::factory('option')->find_all(), 'options');
?>
</div>
<div class="form-fields">
<h5>Product Images</h5>
<div id="admin-product-image">
<?php
foreach ($product->images as $image) {
?>
<?php
echo html::image($image->thumburl);
?>
示例14: __
?>
<?php
echo form::input_wrap(array('name' => 'name', 'maxlength' => 100), $values, '', __('Name'), $errors);
?>
<?php
echo form::input_wrap(array('name' => 'homepage', 'maxlength' => 100, 'title' => 'http://'), $values, '', __('Homepage'), $errors);
?>
<li class="horizontal">
<?php
echo form::checkbox('event_host', '1', !empty($values['event_host']));
?>
<?php
echo form::label('event_host', __('Event host'));
?>
</li>
</ul>
</fieldset>
<fieldset>
<legend><?php
echo __('Contact information');
?>
</legend>
<ul>
<?php
echo form::input_wrap(array('name' => 'address', 'maxlength' => 50), $values, '', __('Address'), $errors);
示例15:
<span><?php
echo Kohana::lang('endtime.applicable_description');
?>
</span></div>
</h4>
<!--<div style = "border: 1px solid black; margin-left:10px;">-->
<div id="endtime_form" style="margin-left:30px; <?php
echo $applicable == "1" ? "" : "display:none;";
?>
" >
<?php
print form::label('remain_on_map', Kohana::lang('decayimage.remain_on_map'));
print form::radio('remain_on_map', 0, $remain_on_map == 0) . "<br />\n";
print form::label('remain_on_map', Kohana::lang('decayimage.decay_from_map'));
print form::radio('remain_on_map', 2, $remain_on_map == 2) . "<br />\n";
print form::label('remain_on_map', Kohana::lang('decayimage.remove_from_map'));
print form::radio('remain_on_map', 1, $remain_on_map == 1) . "<br />\n";
?>
<?php
print form::input('end_incident_date', $form['end_incident_date'], ' class="text"');
?>
<?php
print $date_picker_js;
?>
<br/>
<br/>
<div class="time">
<?php