本文整理汇总了PHP中text_field函数的典型用法代码示例。如果您正苦于以下问题:PHP text_field函数的具体用法?PHP text_field怎么用?PHP text_field使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了text_field函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: input
function input($objectName, $method, $object, $options = array())
{
$attr = $object->getAttribute($method);
switch ($attr->type) {
case 'string':
$str = text_field($objectName, $method, $object, $options);
break;
case 'text':
$str = text_area($objectName, $method, $object, $options);
break;
case 'date':
$str = date_select($objectName, $method, $object);
break;
case 'datetime':
$str = date_time_select($objectName, $method, $object);
break;
case 'integer':
$str = text_field($objectName, $method, $object, $options);
break;
case 'float':
$str = text_field($objectName, $method, $object, $options);
break;
case 'boolean':
$str = check_box($objectName, $method, $object, $options);
break;
default:
$str = hidden_field($objectName, $method, $object);
break;
}
return error_wrapping($str, isset($object->errors[$method]));
}
示例2: testTextfield
public function testTextfield()
{
$this->assertDomEqual(text_field('post', 'title', $this->post), '<input id="post_title" name="post[title]" size="30" type="text" value="PHP for ever" />');
$this->assertDomEqual(password_field('post', 'title', $this->post), '<input id="post_title" name="post[title]" size="30" type="password" value="PHP for ever" />');
$this->assertDomEqual(file_field('post', 'title', $this->post), '<input id="post_title" name="post[title]" type="file" />');
$this->assertDomEqual(text_field('post', 'title', $this->post, array('size' => 35, 'maxlength' => 35)), '<input id="post_title" name="post[title]" size="35" maxlength="35" type="text" value="PHP for ever" />');
$this->assertDomEqual(text_field('post', 'title', $this->post, array('index' => 2)), '<input id="post_2_title" name="post[2][title]" size="30" type="text" value="PHP for ever" />');
}
示例3: content
function content()
{
if (!user_logged_in()) {
return must_log_in();
}
$user = fetch_one_or_none('users', 'id', user_logged_in());
$errors = array();
if (array_key_exists('change', $_POST)) {
if (!isset($_POST['email']) || !$_POST['email']) {
$errors[] = "Please enter an email address";
} else {
$email = $_POST['email'];
if ($email && !validate_email_address($email)) {
$errors[] = "Invalid email address";
}
if (count($errors) == 0 && count(fetch_all('users', 'email_address', $email))) {
$errors[] = "A user with this email address already exists";
}
if (count($errors) == 0) {
update_all('users', array('new_email_address' => $email), 'id', user_logged_in());
send_email_change_email($email, $user->name);
?>
<p>We have sent an email to your new address requesting that you
confirm that change of address.</p>
<?php
return;
}
}
}
$fields = array();
page_header('Change email address');
show_error_list($errors);
?>
<form method="post" action="" accept-charset="UTF-8">
<div class="fieldrow">
<div class="field">
<label>Current address:</label>
<div><tt><?php
esc($user->email_address);
?>
</tt></div>
</div>
</div>
<div class="fieldrow">
<?php
text_field($fields, 'email', 'New address');
?>
</div>
<div class="fieldrow">
<input type="submit" name="change" value="Change"/>
</div>
</form>
<?php
}
示例4: content
function content()
{
global $errors;
?>
<h2>Login</h2>
<p>If you have not yet registered for an account, you will need to
<a href="register">register</a> before you can log in.
If you have have forgotten your password, you can
<a href="request-reset">reset it</a>.</p>
<?php
show_error_list($errors);
?>
<form method="post" action="" accept-charset="UTF-8">
<div class="fieldrow">
<?php
text_field($_POST, 'email', 'Email address');
?>
</div>
<div class="fieldrow">
<div>
<label for="password">Password</label>
<input type="password" id="password" name="password" />
</div>
</div>
<div class="fieldrow">
<input type="checkbox" id="forever" name="forever" value="1"
checked="checked" />
<label for="forever">Stay logged in?
<br/><span class="label-extra">If you are using a shared computer,
you should not set this option.</span></label>
</div>
<div class="fieldrow">
<input type="submit" name="login" value="Login" />
<br/><span class="note">(This sets a cookie,
which logging out clears.)</span>
</div>
<?php
if (array_key_exists('return', $_GET)) {
hidden_field('return', $_GET['return']);
} elseif (array_key_exists('return', $_POST)) {
hidden_field('return', $_POST['return']);
}
?>
</form>
<?php
}
示例5: display_column
function display_column($label, $row, $col_name, $editable = TRUE)
{
print "<tr>\n";
print "<td>" . htmlspecialchars($label) . "</td>\n";
print "<td>";
if ($editable) {
# display as editable field
text_field("row[{$col_name}]", $row[$col_name], 80);
} else {
# display as read-only text
print htmlspecialchars($row[$col_name]);
}
print "</td>\n";
print "</tr>\n";
}
示例6: field_html
function field_html($args, $arrSlide = array())
{
switch ($args['type']) {
case 'textarea':
return text_area($args, $arrSlide);
case 'checkbox':
return checkbox_field($args, $arrSlide);
case 'select':
return select_field($args, $arrSlide);
case 'image':
return image_field($args, $arrSlide);
default:
return text_field($args, $arrSlide);
}
}
示例7: field_html
function field_html($args)
{
switch ($args[2]) {
case 'textarea':
return text_area($args);
case 'checkbox':
case 'radio':
case 'button':
case 'text':
return text_button($args);
case 'submit':
default:
return text_field($args);
}
}
示例8: field_html
function field_html($args)
{
switch ($args[2]) {
case 'textarea':
return text_area($args);
case 'checkbox':
// To Do
// To Do
case 'radio':
// To Do
// To Do
case 'text':
default:
return text_field($args);
}
}
示例9: content
function content()
{
$errors = array();
page_header('Request password reset');
if (array_key_exists('reset', $_POST)) {
if (!isset($_POST['email']) || !$_POST['email']) {
$errors[] = "Please enter an email address";
} else {
$user = fetch_one_or_none('users', 'email_address', $_POST['email']);
if (!$user) {
$errors[] = "Incorrect email address supplied";
}
if (count($errors) == 0) {
$token = make_random_token();
update_all('users', array('activation_token' => $token), 'id', $user->id);
send_reset_email($user->email_address, $user->name, $token);
?>
<p>We have sent you an email containing a link allowing you to reset
your password.</p>
<?php
return;
}
}
}
?>
<p>If you have forgotten your password and need it resetting, please
enter your email address below and we will send you an email allowing
you to reset your password.</p>
<?php
show_error_list($errors);
?>
<form method="post" action="" accept-charset="UTF-8">
<div class="fieldrow">
<?php
text_field($_POST, 'email', 'Email address');
?>
</div>
<div class="fieldrow">
<input type="submit" name="reset" value="Reset" />
</div>
</form>
<?php
}
示例10: field_html
function field_html($args)
{
switch ($args[2]) {
case 'textarea':
return text_area($args);
case 'checkbox':
// Checkbox
return check_box($args);
case 'background_variant':
// Dropmenu
return background_variant($args);
case 'image_url':
// Image URL
return image_url($args);
case 'text':
default:
return text_field($args);
}
}
示例11: render
/**
* Renders attachment based on Object type
*
* @param void
* @return string
*/
function render($element_name)
{
switch ($this->getRelObjectManager()) {
case 'Companies':
case 'Contacts':
case 'ProjectFiles':
case 'ProjectMessages':
case 'ProjectMilestones':
case 'ProjectTasks':
case 'ProjectTaskLists':
case 'ProjectTickets':
return text_field($element_name, $this->getText());
break;
default:
return textarea_field($element_name, $this->getText(), array('class' => 'short'));
break;
}
// switch
}
示例12: project_tabbed_navigation
project_tabbed_navigation(PROJECT_TAB_FORMS);
project_crumbs(array(
array(lang('forms'), get_url('form')),
array($project_form->isNew() ? lang('add form') : lang('edit form'))
));
//add_stylesheet_to_page('project/forms.css');
?>
<form class="internalForm" action="<?php echo $project_form->isNew() ? get_url('form', 'add') : $project_form->getEditUrl() ?>" method="post">
<?php tpl_display(get_template_path('form_errors')) ?>
<div>
<?php echo label_tag(lang('name'), 'projectFormName', true) ?>
<?php echo text_field('project_form[name]', array_var($project_form_data, 'name'), array('id' => 'projectFormName', 'class' => 'long')) ?>
</div>
<div>
<?php echo label_tag(lang('description'), 'projectFormDescription') ?>
<?php echo textarea_field('project_form[description]', array_var($project_form_data, 'description'), array('id' => 'projectFormDescription', 'class' => 'short')) ?>
</div>
<div>
<?php echo label_tag(lang('success message'), 'projectFormSuccessMessage',true) ?>
<?php echo textarea_field('project_form[success_message]', array_var($project_form_data, 'success_message'), array('id' => 'projectFormSuccessMessage', 'class' => 'short')) ?>
</div>
<div class="formBlock" id="projectFormAction">
<fieldset>
<legend><?php echo lang('project form action') ?></legend>
示例13: tpl_display
"></script>
<div id="massMailer">
<form action="<?php
echo $tool->getToolUrl();
?>
" method="post">
<?php
tpl_display(get_template_path('form_errors'));
?>
<div>
<?php
echo label_tag(lang('massmailer subject'), 'massmailerFormRecipient', true);
?>
<?php
echo text_field('massmailer[subject]', array_var($massmailer_data, 'subject'), array('id' => 'massmailerFormRecipient', 'class' => 'title'));
?>
</div>
<div>
<?php
echo label_tag(lang('massmailer message'), 'massmailerFormMessage', true);
?>
<?php
echo textarea_field('massmailer[message]', array_var($massmailer_data, 'message'), array('id' => 'massmailerFormMessage', 'class' => 'editor'));
?>
</div>
<h2><?php
echo lang('massmailer recipients');
?>
示例14: administration_crumbs
administration_crumbs(array(array(lang('administration tools'), get_url('administration', 'tools')), array($tool->getDisplayName())));
?>
<form action="<?php
echo $tool->getToolUrl();
?>
" method="post">
<?php
tpl_display(get_template_path('form_errors'));
?>
<div>
<?php
echo label_tag(lang('test mail recipient'), 'testMailFormRecipient', true);
?>
<?php
echo text_field('test_mail[recipient]', array_var($test_mail_data, 'recipient'), array('id' => 'testMailFormRecipient', 'class' => 'long'));
?>
</div>
<div>
<?php
echo label_tag(lang('test mail message'), 'testMailFormMessage', true);
?>
<?php
echo textarea_field('test_mail[message]', array_var($test_mail_data, 'message'), array('id' => 'testMailFormMessage'));
?>
</div>
<?php
echo submit_button(lang('submit'));
?>
示例15: lang
echo $message->isNew() ? lang('new message') : lang('edit message');
?>
</td><td style="text-align:right">
<?php
echo submit_button($message->isNew() ? lang('add message') : lang('save changes'), 's', array('style' => 'margin-top:0px;margin-left:10px', 'tabindex' => '5'));
?>
</td></tr></table>
</div>
</div>
<div>
<?php
echo label_tag(lang('title'), $genid . 'messageFormTitle', true);
?>
<?php
echo text_field('message[title]', array_var($message_data, 'title'), array('id' => $genid . 'messageFormTitle', 'class' => 'title', 'tabindex' => '1'));
?>
</div>
<?php
$categories = array();
Hook::fire('object_edit_categories', $object, $categories);
?>
<div style="padding-top:5px">
<?php
if ($all) {
?>
<a href="#" class="option" style="font-weight:bold" onclick="og.toggleAndBolden('<?php
echo $genid;
?>