本文整理汇总了PHP中form_tag函数的典型用法代码示例。如果您正苦于以下问题:PHP form_tag函数的具体用法?PHP form_tag怎么用?PHP form_tag使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了form_tag函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: form
function form($objectName, $object, $options = array())
{
if (!isset($options['action'])) {
if ($object->isNewRecord()) {
$options['action'] = 'create';
} else {
$options['action'] = 'update';
}
}
if (!isset($options['submit_value'])) {
$options['submit_value'] = ucfirst($options['action']);
}
if (isset($options['multipart']) && $options['multipart'] === true) {
$form = form_tag(array('action' => $options['action']), array('multipart' => true));
} else {
$form = form_tag(array('action' => $options['action']));
}
if (!$object->isNewRecord()) {
$form .= hidden_field($objectName, 'id', $object);
}
$fields = $object->contentAttributes();
foreach ($fields as $attr) {
$form .= '<p><label for="' . $objectName . '_' . $attr->name . '">' . SInflection::humanize($attr->name) . "</label>\n" . input($objectName, $attr->name, $object) . "</p>\n";
}
if (isset($options['include'])) {
$form .= $options['include'];
}
$form .= submit_tag($options['submit_value']);
$form .= end_form_tag();
return $form;
}
开发者ID:BackupTheBerlios,项目名称:stato-svn,代码行数:31,代码来源:record_helper.php
示例2: pp_button
function pp_button(esPaypalButton $button)
{
$html = array();
foreach ($button as $name => $value) {
$html[] = tag('input', array('type' => 'hidden', 'name' => $name, 'value' => $value));
}
return form_tag($button->getUrl(), array('method' => 'post')) . join("\n", $html) . tag('input', array('type' => 'image', 'src' => $button->getImage(), 'alt' => $button->getAltText())) . '</form>';
}
开发者ID:jmiridis,项目名称:atcsf1,代码行数:8,代码来源:esPaypalHelper.class.php
示例3: form_for
public function form_for($name, $object = null, $url = "", $options = null, $block = null)
{
if (is_closure($options)) {
$block = $options;
$options = array();
}
$this->object = $object;
$this->object_name = $name;
echo form_tag($url, array_merge($options, array("name" => $name)));
echo $block($this);
echo "</form>";
}
开发者ID:ahmed555,项目名称:Cupcake,代码行数:12,代码来源:form.php
示例4: form
function form($content, $attributes)
{
$to = TemplateLogic::content($attributes["to"], $this->data);
$name = array_key_exists("name", $attributes) ? TemplateLogic::content($attributes["name"], $this->data) : $this->getUniqueFormID();
$options = array();
$options["method"] = array_key_exists("method", $attributes) ? $attributes["method"] : "post";
$options["action"] = linkForm($to);
if (array_key_exists("validate", $attributes) && $attributes["validate"] != '') {
$options["onsubmit"] = "return \$validate(this,'" . $attributes["validate"] . "');";
}
//$validate(frm,debug)
if (array_key_exists("files", $attributes) && strToLower($attributes["files"]) == "true") {
$options["enctype"] = "multipart/form-data";
}
$result = $this->process($content);
$select = form_tag($name, $result, $options);
return $select;
}
开发者ID:NerdZombies,项目名称:MateCode,代码行数:18,代码来源:Template.php
示例5: inicioAjax
public static function inicioAjax($accion, $contenedor, $referencia = 0)
{
$params = is_array($accion) ? $accion : Util::getParams(func_get_args());
$params["enctype"] = "multipart/form-data";
if ($referencia == 0) {
$referencia = rand(0, 9999999);
}
$params["name"] = "f" . $referencia;
$params["id"] = "f" . $referencia;
$opciones = 'target: "#' . $contenedor . '"';
if (isset($params["success"])) {
$opciones .= ', success: function() { ' . $params["success"] . ' }';
}
if (isset($params["before"])) {
$opciones .= ', beforeSubmit: function() { ' . $params["before"] . ' }';
}
$code = '<script type="text/javascript"> $.metadata.setType("attr", "validate"); $(document).ready(function() { $("#' . $params["id"] . '").validate({}); $("#' . $params["id"] . '").ajaxForm({ ' . $opciones . ' }); }); </script>';
$code .= form_tag($params);
return $code;
}
开发者ID:raalveco,项目名称:ASPOS-PROJECT,代码行数:20,代码来源:formulario.php
示例6: form_tag
<div class="sf_admin_filters">
<!--
<?php
echo form_tag('tablas/list', array('method' => 'get'));
?>
<fieldset>
<h2><?php
echo __('filters');
?>
</h2>
<div class="form-row">
<?php
echo label_for('filters[id_empresa]', __('empresa'), '');
?>
<div class="content">
<?php
$id_empresa = isset($filters['id_empresa']) ? $filters['id_empresa'] : null;
$c = EmpresaPeer::getCriterioAlcance();
$empresas = EmpresaPeer::doSelect($c);
$value = select_empresas('filters[id_empresa]', objects_for_select($empresas, 'getIdEmpresa', '__toString', $id_empresa, array('include_blank' => true)), array('control_name' => 'filters[id_empresa]', 'include_blank' => true));
echo $value ? $value : " ";
?>
</div>
</div>
</fieldset>
<ul class="sf_admin_actions">
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:31,代码来源:_filters.php
示例7: use_helper
use_helper('I18N', 'Javascript', 'Object', 'Number');
echo include_partial('parametros/mensajes');
?>
<?php
include_partial('datos_edit_titulo', array('DefParametro' => $DefParametro, 'parametro' => $parametro, 'nuevo' => $nuevo));
?>
<?php
if ($DefParametro->getCampoFichero() != "") {
?>
<?php
echo form_tag('parametros/guardar_valor', array('ENCTYPE' => "multipart/form-data", 'method' => 'post', 'id' => 'formulario_guardar'));
} else {
echo form_remote_tag(array('url' => 'parametros/guardar_valor', 'update' => 'datos_parametro', 'script' => 'true', 'complete' => enlaceACargarParametros($DefParametro)), 'id=formulario_guardar');
}
?>
<?php
if ($DefParametro->getCampoNombre() != "") {
?>
<div class="form-row clear">
<?php
echo label_for('nombre', __($DefParametro->getCampoNombre()));
?>
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:30,代码来源:_datos_edit.php
示例8: link_to
<div class="row">
<div class="span4"><?php
echo link_to(op_image_tag_sf_image($community->getImageFileName(), array('size' => '48x48')), '@community_home?id=' . $id);
?>
</div>
<div class="span8"><?php
echo link_to($community->getName(), '@community_home?id=' . $id);
?>
</div>
<div class="span12 center"><?php
echo __('Do you really join to the following %community%?');
?>
</div>
<div class="span12">
<?php
echo form_tag($sf_request->getCurrentUri());
?>
<?php
foreach ($form as $field) {
?>
<?php
if (!$field->isHidden()) {
?>
<div class="control-group<?php
echo $field->hasError() ? ' error' : '';
?>
">
<label class="control-label"><?php
echo $field->renderLabel();
?>
</label>
开发者ID:newZinc,项目名称:OpenPNE3,代码行数:31,代码来源:smtJoinInput.php
示例9: __
?>
<!-- flash messages and new comment form -->
<?php
if ($read_only) {
?>
<div class="related_details"><?php
echo __('Comments are closed');
?>
.</div>
<?php
} else {
?>
<?php
echo form_tag('deppCommenting/addComment', 'name=add_comment id=comment-form');
?>
<h4><?php
echo __('Leave a reply');
?>
</h4>
<?php
echo form_error('name');
?>
<p>
<?php
echo image_tag('star.png', array('alt' => '*'));
?>
<?php
echo input_tag('name', $sf_request->hasErrors() ? $sf_params->get('name') : ($sf_user->isAuthenticated() ? isset($author_name) ? $author_name : '' : ''), 'id= class=text' . ($sf_user->isAuthenticated() ? ' readonly=true' : ''));
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:31,代码来源:_addComment.php
示例10: form_tag
<?php
echo form_tag('historico_documentos/edit', array('id' => 'sf_admin_edit_form', 'name' => 'sf_admin_edit_form', 'multipart' => true));
?>
<?php
echo object_input_hidden_tag($historico_documento, 'getIddocumento');
echo object_input_hidden_tag($historico_documento, 'getVersion');
?>
<fieldset id="sf_fieldset_none" class="">
<div class="form-row">
<?php
echo label_for('historico_documento[id_documento]', __($labels['historico_documento{id_documento}']), '');
?>
<div class="content<?php
if ($sf_request->hasError('historico_documento{id_documento}')) {
?>
form-error<?php
}
?>
">
<?php
if ($sf_request->hasError('historico_documento{id_documento}')) {
?>
<?php
echo form_error('historico_documento{id_documento}', array('class' => 'form-error-msg'));
?>
<?php
}
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:31,代码来源:_edit_form.php
示例11: url_for
});
$("#collections_parent_ref").change(function() {
if($(this).val())
{
$.get("<?php
echo url_for('collection/setInstitution');
?>
/parent_ref/"+$(this).val(), function (data) {
$("#institution_to_change").html(data);
});
}
});
});
</script>
<?php
echo form_tag('collection/' . ($form->getObject()->isNew() ? 'create' : 'update?id=' . $form->getObject()->getId()), array('class' => 'edition'));
echo $form->renderGlobalErrors();
?>
<table class="collections">
<tbody>
<tr>
<th>
<?php
echo $form['is_public']->renderLabel("Public collection");
?>
<?php
echo help_ico($form['is_public']->renderHelp(), $sf_user);
?>
</th>
<td>
<?php
开发者ID:naturalsciences,项目名称:Darwin,代码行数:31,代码来源:_form.php
示例12: use_helper
<?php
use_helper('Validation');
use_helper('Object');
include_partial('global/page_header', array('title' => 'Weryfikacja właściciela bloga'));
echo form_tag('blog/verification');
?>
<fieldset>
<div class="row">
<label for="login">Wybierz swój blog: </label>
<?php
echo select_tag('blog_id', objects_for_select($blogs, 'getId', 'getName'));
?>
</div>
<div class="infobox"><p class="center">Podaj swój login i hasło z <a href="http://forum.php.pl">Forum PHP.pl</a></p></div>
<div class="row">
<?php
echo form_error('login');
?>
<label for="login">Login: </label>
<?php
echo input_tag('login');
?>
</div>
<div class="row">
<?php
echo form_error('password');
?>
开发者ID:noose,项目名称:Planeta,代码行数:31,代码来源:verificationForm.php
示例13: include_stylesheets_for_form
<?php
include_stylesheets_for_form($form);
include_javascripts_for_form($form);
?>
<div class="import_filter">
<?php
echo form_tag($format == 'taxon' ? 'import/searchCatalogue' : 'import/search', array('class' => 'search_form', 'id' => 'import_filter'));
?>
<div class="container">
<table class="search" id="search">
<thead>
<tr>
<th><?php
if ($format != 'taxon') {
echo $form['collection_ref']->renderLabel();
}
?>
</th>
<th><?php
echo $form['filename']->renderLabel();
?>
</th>
<th><?php
echo $form['state']->renderLabel();
?>
</th>
<th><?php
echo $form['show_finished']->renderLabel();
?>
</th>
开发者ID:naturalsciences,项目名称:Darwin,代码行数:31,代码来源:_searchForm.php
示例14: use_helper
<?php
use_helper('Form', 'Validation', 'Widgets');
echo form_tag('manage/RemoveCustomProcess', array('class' => 'main-form'));
?>
<?php
echo form_errors();
?>
<p> The following <strong><?php
echo $count;
?>
</strong> kanji flashcard(s) have been removed:</p>
<div style="background:#E7F5CD;color:#000;padding:5px;margin:0 0 1em;">
<?php
$kanjis = array();
foreach ($cards as $id) {
$kanjis[] = rtkBook::getKanjiForIndex($id);
}
echo implode(', ', $kanjis);
?>
</div>
<p><a href="#" class="proceed" onclick="return ManageFlashcards.load(this,{'reset':true});">Remove more cards</a></p>
</form>
开发者ID:kc5nra,项目名称:RevTK,代码行数:28,代码来源:_RemoveCustomProcessView.php
示例15: link_to
<?php
echo link_to(image_tag('askeet_logo.gif', 'alt=askeet align=middle'), '@homepage');
?>
<?php
echo __('ask %1%it%2% - find %1%it%2% - answer %1%it%2%', array('%1%' => '<strong>', '%2%' => '</strong>'));
?>
</h1>
</div>
<div id="login" style="display: none">
<h2><?php
echo __('please sign-in first');
?>
</h2>
<?php
echo form_tag('@login', 'id=loginform');
?>
<label for="nickname"><?php
echo __('nickname:');
?>
</label><?php
echo input_tag('nickname');
?>
<label for="password"><?php
echo __('password:');
?>
</label><?php
echo input_password_tag('password');
?>
<?php
echo input_hidden_tag('referer', $sf_params->get('referer') ? $sf_params->get('referer') : $sf_request->getUri());
开发者ID:emacsattic,项目名称:symfony,代码行数:31,代码来源:layout.php
示例16: include_stylesheets_for_form
<?php
include_stylesheets_for_form($form);
include_javascripts_for_form($form);
?>
<div class="catalogue_comments">
<?php
echo form_tag('comment/search', array('class' => 'search_form', 'id' => 'comments_filter'));
?>
<div class="container">
<table class="search" id="<?php
echo $is_choose ? 'search_and_choose' : 'search';
?>
">
<thead>
<tr>
<th ><?php
echo $form['referenced_relation']->renderLabel();
?>
<?php
echo $form['referenced_relation']->renderError();
?>
</th>
<th ><?php
echo $form['comment']->renderLabel();
?>
<?php
echo $form['comment']->renderError();
?>
</th>
<th><?php
开发者ID:naturalsciences,项目名称:Darwin,代码行数:31,代码来源:_searchForm.php
示例17: form_tag
<?php
echo form_tag('@sf_guard_user_export');
?>
<table>
<tr><th><?php
echo __('Include in Export', array(), 'messages');
?>
</th><th><?php
echo __('Field', array(), 'messages');
?>
</th><th><?php
echo __('Label (optional)', array(), 'messages');
?>
</th></tr>
<tr>
<td><input name="include[id]" type="checkbox" checked /></td>
<td><?php
echo __('Id', array(), 'messages');
?>
</td>
<td>
<input name="export[id]" type="textbox" size="20">
</td>
</tr>
<tr>
<td><input name="include[username]" type="checkbox" checked /></td>
<td><?php
echo __('Username', array(), 'messages');
?>
</td>
开发者ID:robertsergio,项目名称:Hadori-Demo,代码行数:31,代码来源:_export_form.php
示例18: use_helper
<?php
use_helper('Object', 'Date', 'sfAsset');
echo form_tag('sfAsset/save', array('id' => 'sf_admin_edit_form', 'name' => 'sf_admin_edit_form', 'multipart' => true));
?>
<?php
echo object_input_hidden_tag($sf_asset, 'getId');
?>
<fieldset id="sf_fieldset_none" class="">
<div class="form-row">
<?php
echo label_for('sf_asset[filepath]', __('Path:', null, 'sfAsset'), '');
?>
<div class="content<?php
if ($sf_request->hasError('sf_asset{filepath}')) {
?>
form-error<?php
}
?>
">
<?php
if (!$sf_asset->isNew()) {
?>
<?php
echo assets_library_breadcrumb($sf_asset->getRelativePath(), 0);
?>
<?php
}
开发者ID:rewrewby,项目名称:propertyx,代码行数:31,代码来源:_edit_form.php
示例19: include_stylesheets_for_form
<?php
include_stylesheets_for_form($form);
include_javascripts_for_form($form);
echo form_tag('loan/search' . (isset($is_choose) ? '?is_choose=' . $is_choose : ''), array('class' => 'search_form', 'id' => 'loans_filter'));
?>
<div class="container">
<table class="search" id="<?php
echo $is_choose ? 'search_and_choose' : 'search';
?>
">
<thead>
<tr>
<th><?php
echo $form['name']->renderLabel();
?>
</th>
<th><?php
echo $form['status']->renderLabel();
?>
</th>
<th><?php
echo $form['from_date']->renderLabel();
?>
</th>
<th><?php
echo $form['to_date']->renderLabel();
?>
</th>
</tr>
</thead>
开发者ID:naturalsciences,项目名称:Darwin,代码行数:31,代码来源:_searchForm.php
示例20: form_tag
<?php
echo form_tag('tablas/edit', array('id' => 'sf_admin_edit_form', 'name' => 'sf_admin_edit_form', 'multipart' => true, 'onsubmit' => 'double_list_submit(); return true;'));
?>
<?php
echo object_input_hidden_tag($tabla, 'getIdTabla');
?>
<fieldset id="sf_fieldset_editable" class="">
<h2><?php
echo __('Datos');
?>
</h2>
<div class="form-row">
<?php
echo label_for('tabla[nombre]', __($labels['tabla{nombre}']), 'class="required" ');
?>
<div class="content<?php
if ($sf_request->hasError('tabla{nombre}')) {
?>
form-error<?php
}
?>
">
<?php
if ($sf_request->hasError('tabla{nombre}')) {
?>
<?php
echo form_error('tabla{nombre}', array('class' => 'form-error-msg'));
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:30,代码来源:_edit_form.php
注:本文中的form_tag函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论