本文整理汇总了PHP中form::text方法的典型用法代码示例。如果您正苦于以下问题:PHP form::text方法的具体用法?PHP form::text怎么用?PHP form::text使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类form
的用法示例。
在下文中一共展示了form::text方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: meta_acpt_slide_options
function meta_acpt_slide_options()
{
$form = new form('slide', null);
$form->image('image', array('label' => 'Image URL', 'help' => 'Upload an Image that is 940px by 350px for best results', 'button' => 'Add Your Slide'));
$form->text('headline', array('label' => 'Headline'));
$form->textarea('description', array('label' => 'Description'));
$form->select('showText', array('Yes', 'No'), array('label' => 'Show Headline and Description'));
}
示例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: meta_custom
function meta_custom()
{
$form = new form('details', null);
$form->text('name', array('label' => 'Text Field'));
$form->image('image', array('label' => 'Image Field', 'button' => 'Add Your Image'));
$form->file('file', array('label' => 'File Field', 'button' => 'Select a File'));
$form->textarea('address', array('label' => 'Textarea', 'validate' => 'html'));
$form->select('rooms', array('one', 'two', 'three'), array('label' => 'Select List'));
$form->radio('baths', array('blue', 'green', 'red'), array('label' => 'Radio Buttons'));
$form->editor('baths', 'WYSIWYG Editor');
}
示例4: gui
public function gui($url)
{
# Create list
if (!empty($_POST['createlist'])) {
try {
$this->defaultWordsList();
http::redirect($url . '&list=1');
} catch (Exception $e) {
$this->okt->error->set($e->getMessage());
}
}
# Adding a word
if (!empty($_POST['swa'])) {
try {
$this->addRule($_POST['swa']);
http::redirect($url . '&added=1');
} catch (Exception $e) {
$okt->error->add($e->getMessage());
}
}
# Removing spamwords
if (!empty($_POST['swd']) && is_array($_POST['swd'])) {
try {
$this->removeRule($_POST['swd']);
http::redirect($url . '&removed=1');
} catch (Exception $e) {
$okt->error->add($e->getMessage());
}
}
/* DISPLAY
---------------------------------------------- */
global $okt;
$okt->page->messages->success('list', __('m_antispam_Words_successfully_added'));
$okt->page->messages->success('added', __('m_antispam_Word_successfully_added'));
$okt->page->messages->success('removed', __('m_antispam_Words_successfully_removed'));
$res = '';
$res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('m_antispam_Add_word') . '</legend>' . '<p>' . form::text('swa', 20, 128) . ' ';
$res .= adminPage::formtoken() . '<input type="submit" value="' . __('c_c_action_Add') . '"/></p>' . '</fieldset>' . '</form>';
$rs = $this->getRules();
if ($rs->isEmpty()) {
$res .= '<p><strong>' . __('m_antispam_No_word_in_list') . '</strong></p>';
} else {
$res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('m_antispam_List') . '</legend>' . '<div style="' . $this->style_list . '">';
while ($rs->fetch()) {
$disabled_word = false;
$p_style = $this->style_p;
$res .= '<p style="' . $p_style . '"><label class="classic">' . form::checkbox(array('swd[]'), $rs->rule_id, false) . ' ' . html::escapeHTML($rs->rule_content) . '</label></p>';
}
$res .= '</div>' . '<p>' . form::hidden(array('spamwords'), 1) . adminPage::formtoken() . '<input type="submit" value="' . __('m_antispam_Delete_selected_words') . '"/></p>' . '</fieldset></form>';
}
$res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<p><input type="submit" value="' . __('m_antispam_Create_default_wordlist') . '" />' . form::hidden(array('spamwords'), 1) . form::hidden(array('createlist'), 1) . adminPage::formtoken() . '</p>' . '</form>';
return $res;
}
示例5: getHtmlField
public function getHtmlField($aPostedData)
{
$return = '';
switch ($this->type) {
# Champ texte
default:
case 1:
$return = '<p class="field" id="' . $this->html_id . '-wrapper">' . '<label for="' . $this->html_id . '"' . ($this->status == 2 ? ' class="required" title="' . __('c_c_required_field') . '"' : '') . '>' . html::escapeHTML($this->title) . '</label>' . form::text($this->html_id, 60, 255, $aPostedData[$this->id]) . '</p>';
break;
# Zone de texte
# Zone de texte
case 2:
$return = '<p class="field" id="' . $this->html_id . '-wrapper">' . '<label for="' . $this->html_id . '"' . ($this->status == 2 ? ' class="required" title="' . __('c_c_required_field') . '"' : '') . '>' . html::escapeHTML($this->title) . '</label>' . form::textarea($this->html_id, 58, 10, $aPostedData[$this->id]) . '</p>';
break;
# Menu déroulant
# Menu déroulant
case 3:
$values = array_filter((array) unserialize($this->value));
$return = '<p class="field" id="' . $this->html_id . '-wrapper">' . '<label for="' . $this->html_id . '"' . ($this->status == 2 ? ' class="required" title="' . __('c_c_required_field') . '"' : '') . '>' . html::escapeHTML($this->title) . '</label>' . form::select($this->html_id, array_flip($values), $aPostedData[$this->id]) . '</p>';
break;
# Boutons radio
# Boutons radio
case 4:
$values = array_filter((array) unserialize($this->value));
$str = '';
foreach ($values as $k => $v) {
$str .= '<li><label>' . form::radio(array($this->html_id, $this->html_id . '_' . $k), $k, $k == $aPostedData[$this->id]) . html::escapeHTML($v) . '</label></li>';
}
$return = '<p class="field" id="' . $this->html_id . '-wrapper">' . '<span class="fake-label">' . html::escapeHTML($this->title) . '</span></p>' . '<ul class="checklist">' . $str . '</ul>';
break;
# Cases à cocher
# Cases à cocher
case 5:
$values = array_filter((array) unserialize($this->value));
$str = '';
foreach ($values as $k => $v) {
$str .= '<li><label>' . form::checkbox(array($this->html_id . '[' . $k . ']', $this->html_id . '_' . $k), $k, in_array($k, $aPostedData[$this->id])) . html::escapeHTML($v) . '</label></li>';
}
$return = '<p class="field" id="' . $this->html_id . '-wrapper">' . '<span class="fake-label">' . html::escapeHTML($this->title) . '</span></p>' . '<ul class="checklist">' . $str . '</ul>';
break;
}
return $return;
}
示例6: displayForms
private function displayForms($url, $type, $title)
{
$res = '<h3>' . $title . '</h3>' . '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('m_antispam_Add_IP_address') . '</legend><p>' . form::hidden(array('ip_type'), $type) . form::text(array('addip'), 18, 255) . ' ';
$res .= adminPage::formtoken() . '<input type="submit" value="' . __('c_c_action_Add') . '"/></p>' . '</fieldset></form>';
$rs = $this->getRules($type);
if ($rs->isEmpty()) {
$res .= '<p><strong>' . __('m_antispam_No_IP_address_in_list') . '</strong></p>';
} else {
$res .= '<form action="' . html::escapeURL($url) . '" method="post">' . '<fieldset><legend>' . __('m_antispam_IP_list') . '</legend>' . '<div style="' . $this->style_list . '">';
while ($rs->fetch()) {
$bits = explode(':', $rs->rule_content);
$pattern = $bits[0];
$ip = $bits[1];
$bitmask = $bits[2];
$p_style = $this->style_p;
$res .= '<p style="' . $p_style . '"><label class="classic">' . form::checkbox(array('delip[]'), $rs->rule_id, false) . ' ' . html::escapeHTML($pattern) . '</label></p>';
}
$res .= '</div>' . '<p><input type="submit" value="' . __('c_c_action_Delete') . '"/>' . adminPage::formtoken() . form::hidden(array('ip_type'), $type) . '</p>' . '</fieldset></form>';
}
return $res;
}
示例7: foreach
<?php
foreach ($okt->languages->list as $aLanguage) {
?>
<p class="field" lang="<?php
echo $aLanguage['code'];
?>
"><label for="p_public_url_<?php
echo $aLanguage['code'];
?>
"><?php
printf(__('m_partners_%s_%s'), '<code>' . $okt->config->app_url . $aLanguage['code'] . '/</code>', html::escapeHTML($aLanguage['title']));
?>
<span class="lang-switcher-buttons"></span></label>
<?php
echo form::text(array('p_public_url[' . $aLanguage['code'] . ']', 'p_public_url_' . $aLanguage['code']), 40, 255, isset($okt->partners->config->public_url[$aLanguage['code']]) ? html::escapeHTML($okt->partners->config->public_url[$aLanguage['code']]) : '');
?>
</p>
<?php
}
?>
</fieldset>
</div><!-- #tab_seo -->
</div><!-- #tabered -->
<p><?php
echo form::hidden('m', 'partners');
示例8: if
?>
<option value="<?php
echo $listAll[$i]["cat_id"];
?>
"<? if($listAll[$i]["cat_id"] == $iCat) echo ' selected="selected"';?>><? for($j=0;$j<$listAll[$i]["level"];$j++) echo "--"; ?> <?php
echo $listAll[$i]["cat_name"];
?>
</option>
<?
}
?>
</select>
</td>
</tr>
<?php
echo $form->text("Link tới category", "link_category", "link_category", $link_category, "Link tới category", 0, 250, "", 1000, "", 'disabled="disabled"', "");
echo $form->button("button", "create_link_category", "create_link_category", "Tạo link", "Tạo link tới category", '" onClick="link_to_category()"', "");
echo $form->hidden("object", "object", $object, "");
?>
<?
$form->close_table();
$form->close_form();
unset($form);
//---------------------------- Create link to data -----------------------------------
if(isset($arrayData)){
//Search data
$id = getValue("id");
$keyword = getValue("keyword", "str", "GET", "", 1);
$sqlWhere = "";
//Tìm theo ID
示例9: isset
echo form::text(array('p_public_list_url[' . $aLanguage['code'] . ']', 'p_public_list_url_' . $aLanguage['code']), 60, 255, isset($okt->diary->config->public_list_url[$aLanguage['code']]) ? html::escapeHTML($okt->diary->config->public_list_url[$aLanguage['code']]) : '');
?>
</p>
<p class="field" lang="<?php
echo $aLanguage['code'];
?>
"><label for="p_public_event_url_<?php
echo $aLanguage['code'];
?>
"><?php
printf(__('m_diary_event_url_from_%s_in_%s'), '<code>' . $okt->config->app_url . $aLanguage['code'] . '/</code>', html::escapeHTML($aLanguage['title']));
?>
<span class="lang-switcher-buttons"></span></label>
<?php
echo form::text(array('p_public_event_url[' . $aLanguage['code'] . ']', 'p_public_event_url_' . $aLanguage['code']), 60, 255, isset($okt->diary->config->public_event_url[$aLanguage['code']]) ? html::escapeHTML($okt->diary->config->public_event_url[$aLanguage['code']]) : '');
?>
</p>
<?php
}
?>
</fieldset>
</div><!-- #tab_seo -->
</div><!-- #tabered -->
<p><?php
echo form::hidden('m', 'diary');
?>
<?php
示例10:
center"><?php
echo form::checkbox(array('filters_active[]'), $fid, $f->active);
?>
</td>
<td class="<?php
echo $td_class;
?>
center"><?php
echo form::checkbox(array('filters_auto_del[]'), $fid, $f->auto_delete);
?>
</td>
<td class="<?php
echo $td_class;
?>
center"><?php
echo form::text(array('f_order[' . $fid . ']'), 2, 5, (string) $i);
?>
</td>
<td class="<?php
echo $td_class;
?>
"><?php
echo $f->hasGUI() ? '<a href="' . html::escapeHTML($f->guiURL()) . '">' . __('m_antispam_Filter_configuration') . '</a>' : ' ';
?>
</td>
</tr>
<?php
$i++;
}
?>
示例11: foreach
<?php
foreach ($okt->languages->list as $aLanguage) {
?>
<p class="field" lang="<?php
echo $aLanguage['code'];
?>
"><label for="p_title_<?php
echo $aLanguage['code'];
?>
"><?php
$okt->languages->unique ? _e('m_galleries_plupload_items_title') : printf(__('m_galleries_plupload_items_title_in_%s'), $aLanguage['title']);
?>
<span class="lang-switcher-buttons"></span></label>
<?php
echo form::text(array('p_title[' . $aLanguage['code'] . ']', 'p_title_' . $aLanguage['code']), 100, 255, html::escapeHTML($aItemLocalesData[$aLanguage['code']]['title']));
?>
</p>
<?php
}
?>
</div>
<p class="field col"><label for="gallery_id" title="<?php
_e('c_c_required_field');
?>
" class="required"><?php
_e('m_galleries_plupload_gallery');
?>
</label>
示例12: News
?>
<script>
var News = new News();
</script>
<?php
echo $form->form_open();
?>
<?php
echo $form->textnote('Các trường có dấu (<span class="form-asterick">*</span>) là bắt buộc nhập');
?>
<?php
echo $form->textnote('Các trường có dấu (<span class="form-asterick">*</span>) là bắt buộc nhập');
?>
<?php
echo $form->text(array('label' => 'Email', 'name' => 'use_email', 'id' => 'use_email', 'value' => getValue('use_email', 'str', 'POST', $use_email), 'require' => 1, 'errorMsg' => 'Bạn chưa nhập email', 'placeholder' => 'Email không dài quá 255 ký tự'), 0, 'span6');
?>
<?php
echo $form->text(array('label' => 'Họ', 'name' => 'use_firstname', 'id' => 'use_firstname', 'value' => getValue('use_firstname', 'str', 'POST', $use_firstname), 'require' => 1, 'errorMsg' => 'Bạn chưa nhập họ', 'placeholder' => 'Họ'), 0, 'span6');
?>
<?php
echo $form->text(array('label' => 'Tên', 'name' => 'use_lastname', 'id' => 'use_lastname', 'value' => getValue('use_lastname', 'str', 'POST', $use_lastname), 'require' => 1, 'errorMsg' => 'Bạn chưa nhập tên', 'placeholder' => 'Tên'), 0, 'span6');
?>
<?php
echo $form->getFile(array('label' => 'Ảnh đại diện', 'title' => 'Ảnh đại diện', 'name' => 'use_avatar', 'id' => 'use_avatar'));
?>
<?php
echo $form->text(array('label' => 'Ngày sinh', 'name' => 'use_birthday', 'id' => 'use_birthday', 'isdatepicker' => 1, 'value' => getValue('use_birthday', 'str', 'POST', date('d/m/Y', $use_birthday))));
?>
<?php
echo $form->text(array('label' => 'Điện thoại', 'name' => 'use_phone', 'id' => 'use_phone', 'value' => getValue('use_phone', 'str', 'POST', $use_phone), 'require' => 1, 'errorMsg' => 'Bạn chưa nhập điện thoại', 'placeholder' => 'Điện thoại'), 0, 'span6');
示例13: setFilterNbPerPage
protected function setFilterNbPerPage()
{
if (isset($this->config->filters) && !$this->config->filters[$this->part]['nb_per_page']) {
return null;
}
$this->setIntFilter('nb_per_page');
$this->fields['nb_per_page'] = array($this->form_id . '_nb_per_page', __('c_c_sorting_Number_per_page'), form::text(array('nb_per_page', $this->form_id . '_nb_per_page'), 3, 3, $this->params->nb_per_page, $this->getActiveClass('nb_per_page')));
}
示例14: empty
<?php
$view->js('http://bar.iv-dev.de/icons.js');
if (!empty($_POST['src'])) {
$dst = empty($_POST['dst']) ? $_POST['src'] : $_POST['dst'];
file_put_contents("assets/large/{$dst}.png", file_get_contents("http://bar.iv-dev.de/big/{$_POST['src']}.png"));
file_put_contents("assets/small/{$dst}.png", file_get_contents("http://bar.iv-dev.de/icons/{$_POST['src']}.png"));
$view->box("Icon {$_POST['src']} wurde geladen", "Erfolg");
}
$form = new form(MODUL_SELF);
$form->text('src', 'Quell-Datei');
$form->text('dst', 'Ziel-Datei');
$view->box($form, 'Iconloader');
$view->box('<img width="700" onclick="$(\'input[name=src]\').val( function() { var i = icons[Math.floor(event.layerX/20)+Math.floor(event.layerY/20)*35]; return i.substring( 6, i.length-4 ); });" alt="iconmap" style="position: relative;" src="http://bar.iv-dev.de/iconmap.png">', 'Iconliste');
示例15: printf
printf($error, 'Betreff oder Nachricht zu lang');
} elseif ($to == $user->id) {
printf($error, 'Nachrichten mit sich selber zu schreiben, zeugt von Schizophrenie!');
} else {
$message = array("date" => time(), "to" => $to, "from" => $userdata['id'], "subject" => $_POST['subject'], "content" => $_POST['content']);
$message['owner'] = $to;
$db->insert('user_msg', $message);
$message['owner'] = $user->id;
$db->insert('user_msg', $message);
$db->query("UPDATE user_data SET pns = pns + 1 WHERE id = %d", $to);
throw new redirect(PAGE_SELF);
}
}
if (empty($_GET['view'])) {
$sql = "SELECT msg.*, von.name 'from_name', an.name 'to_name' FROM `user_msg` msg\n\t\t\t\t\tLEFT JOIN `user_data` von ON ( msg.`from` = von.id )\n\t\t\t\t\tLEFT JOIN `user_data` an ON ( msg.`to` = an.id )\n\t\t\t\t\tWHERE msg.owner = %d AND msg.`%s` = %d\n\t\t\t\t\tORDER BY id DESC";
$inbox = $db->query($sql, $user->id, 'to', $user->id);
$outbox = $db->query($sql, $user->id, 'from', $user->id);
$db->user_data->updateRow(array('pns' => 0), $user->id);
$form = new form(PAGE_SELF, 'Senden');
$form->text('to', 'Empfänger')->input('class', 'input-xxlarge');
$form->text('subject', 'Betreff')->input('class', 'input-xxlarge');
$form->textarea('content', 'Nachricht')->input('class', 'input-xxlarge')->input('rows', 10);
template('messages')->display(array('incoming' => $inbox->assocs(), 'outgoing' => $outbox->assocs(), 'form' => $form));
} else {
$sql = "SELECT msg.*, von.name 'from_name', an.name 'to_name' FROM `user_msg` msg\n\t\t\t\t\tLEFT JOIN `user_data` von ON ( msg.`from` = von.id )\n\t\t\t\t\tLEFT JOIN `user_data` an ON ( msg.`to` = an.id )\n\t\t\t\t\tWHERE msg.owner = %d AND msg.id = %d\n\t\t\t\t\tORDER BY id DESC";
if (!($message = $db->query($sql, $user->id, $_GET['view'])->assoc())) {
throw new Exception('Nachricht nicht gefunden');
}
$db->user_msg->updateRow(array('readed' => 1), $message['id']);
template('view_message')->display(array('message' => $message));
}