本文整理汇总了PHP中button_to函数的典型用法代码示例。如果您正苦于以下问题:PHP button_to函数的具体用法?PHP button_to怎么用?PHP button_to使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了button_to函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
$t->is(link_to('test', '@homepage', array('absolute' => true)), '<a href="/module/action">test</a>', 'link_to() can take an "absolute" option');
$t->is(link_to('test', '@homepage', array('absolute' => false)), '<a href="module/action">test</a>', 'link_to() can take an "absolute" option');
$t->is(link_to('test', '@homepage', array('query_string' => 'foo=bar')), '<a href="module/action?foo=bar">test</a>', 'link_to() can take a "query_string" option');
$t->is(link_to('test', '@homepage', array('anchor' => 'bar')), '<a href="module/action#bar">test</a>', 'link_to() can take an "anchor" option');
$t->is(link_to('', '@homepage'), '<a href="module/action">module/action</a>', 'link_to() takes the url as the link name if the first argument is empty');
$t->like(link_to('test', '@homepage', array('method' => 'post')), '/==TOKEN==/', 'link_to() includes CSRF token from BaseForm');
// button_to()
$t->diag('button_to()');
$t->is(button_to('test', '@homepage'), '<input value="test" type="button" onclick="document.location.href=\'module/action\';" />', 'button_to() returns an HTML "input" tag');
$t->is(button_to('test', '@homepage', array('query_string' => 'foo=bar')), '<input value="test" type="button" onclick="document.location.href=\'module/action?foo=bar\';" />', 'button_to() returns an HTML "input" tag');
$t->is(button_to('test', '@homepage', array('anchor' => 'bar')), '<input value="test" type="button" onclick="document.location.href=\'module/action#bar\';" />', 'button_to() returns an HTML "input" tag');
$t->is(button_to('test', '@homepage', array('popup' => 'true', 'query_string' => 'foo=bar')), '<input value="test" type="button" onclick="var w=window.open(\'module/action?foo=bar\');w.focus();return false;" />', 'button_to() returns an HTML "input" tag');
$t->is(button_to('test', '@homepage', 'popup=true'), '<input value="test" type="button" onclick="var w=window.open(\'module/action\');w.focus();return false;" />', 'button_to() accepts options as string');
$t->is(button_to('test', '@homepage', 'confirm=really?'), '<input value="test" type="button" onclick="if (confirm(\'really?\')) { return document.location.href=\'module/action\';} else return false;" />', 'button_to() works with confirm option');
$t->is(button_to('test', '@homepage', 'popup=true confirm=really?'), '<input value="test" type="button" onclick="if (confirm(\'really?\')) { var w=window.open(\'module/action\');w.focus(); };return false;" />', 'button_to() works with confirm and popup option');
$t->like(button_to('test', '@homepage', array('method' => 'post')), '/==TOKEN==/', 'button_to() includes CSRF token from BaseForm');
class testObject
{
}
try {
$o1 = new testObject();
link_to($o1, '@homepage');
$t->fail('link_to() can take an object as its first argument if __toString() method is defined');
} catch (sfException $e) {
$t->pass('link_to() can take an object as its first argument if __toString() method is defined');
}
class testObjectWithToString
{
public function __toString()
{
return 'test';
示例2: isset
?>
<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">
<li><?php
echo button_to(__('reset'), 'tablas/list?filter=filter', 'class=sf_admin_action_reset_filter');
?>
</li>
<li><?php
echo submit_tag(__('filter'), 'name=filter class=sf_admin_action_filter');
?>
</li>
</ul>
</form>
-->
</div>
示例3: button_to
if ($sf_user->hasCredential('admin') || $sf_user->hasCredential('importer')) {
?>
<br />
<?php
if (isset($id)) {
?>
<?php
echo button_to('view', "@railsMap?id=" . $id);
?>
<br />
<?php
}
if (isset($id)) {
?>
<?php
echo button_to('meta', "@railsMapEditMeta?id=" . $id);
?>
<br />
<?php
}
?>
<input id="netmap_save" type="button" value="save" /><br />
<?php
}
?>
<div id="netmap_add_entity">
<div id="netmap_add_entity_hide"><a id="netmap_add_entity_hide_link" onclick="$('#netmap_add_entity').css('display', 'none'); return false;">hide</a></div>
<?php
include_partial('global/section', array('title' => 'Add Entity'));
?>
示例4: button_to
<ul class="sf_admin_actions">
<li><?php
echo button_to(__('create'), 'informes/create', array('class' => 'sf_admin_action_create'));
?>
</li>
</ul>
示例5: button_to
<?php
// auto-generated by sfPropelAdmin
// date: 2008/03/26 17:56:58
?>
<ul class="sf_admin_actions">
<?php
if ($sf_user->hasCredential(array(0 => array(0 => 'administrator', 1 => 'vocabularymaintainer', 2 => 'vocabularyadmin')))) {
?>
<li><?php
$concept = $sf_user->getAttribute('concept', '', sfUser::ATTRIBUTE_NAMESPACE);
$conceptId = $concept ? '?concept_id=' . $concept->getId() : '';
echo button_to(__('Add Property'), 'conceptprop/create' . $conceptId . '', array('title' => 'Create', 'class' => 'sf_admin_action_create'));
?>
</li>
<?php
} else {
?>
<?php
}
?>
</ul>
示例6: __
echo $value ? $value : ' ';
?>
<div class="sf_edit_help"><?php
echo __('Indique el orden de la tabla dentro de la lisa');
?>
</div>
</div>
</div>
</fieldset>
<?php
include_partial('edit_actions', array('tabla' => $tabla));
?>
</form>
<?php
if ($tabla->getIdTabla()) {
?>
<ul class="sf_admin_actions">
<li class="float-left">
<?php
echo button_to(__('Borrar'), 'tablas/delete?id_tabla=' . $tabla->getIdTabla(), array('post' => true, 'confirm' => __('¿Quiere borrar este objeto?'), 'class' => 'sf_admin_action_delete'));
?>
</li>
</ul>
<?php
}
示例7: include_partial
<?php
include_partial('global/formerrors', array('form' => array($address_form, $reference_form)));
?>
<form action="<?php
echo url_for('entity/editAddress');
?>
" method="POST">
<?php
echo input_hidden_tag('id', $address->id);
?>
<table>
<?php
include_partial('reference/required', array('form' => $reference_form));
?>
<?php
include_partial('global/form', array('form' => $address_form));
?>
<td></td>
<td>
<?php
echo submit_tag('Save');
?>
<?php
echo button_to('Cancel', 'entity/address?id=' . $address->id);
?>
</table>
</form>
示例8: url_for
<input type="hidden" name="rm" value="2" />
<input type="hidden" name="return" value="<?php
echo url_for('@buy_process', true);
?>
" />
<input type="hidden" name="cancel_return" value="<?php
echo url_for('@buy_cancel', true);
?>
" />
<input type="hidden" name="currency_code" value="USD" />
<input type="hidden" name="country" value="US" />
<input type="hidden" name="no_shipping" value="1" />
<input type="hidden" name="no_note" value="1" />
<input type="hidden" name="invoice" value="<?php
echo $payment->getId();
?>
" />
<img alt="" id="btnPaypal" src="/img/common/paypal.gif" />
<input type="submit" name="submit" value="<?php
echo __("Confirm");
?>
"/>
<?php
echo button_to(__('Cancel'), '@buy_cancel');
?>
</form>
</td>
</tr>
</table>
<?php
}
示例9: button_to
?>
</form>
<?php
if ($mensaje->getPrimaryKey()) {
?>
<ul class="sf_admin_actions">
<?php
$value = "";
$usuario = Usuario::getUsuarioActual();
if ($usuario->getPrimaryKey() == $mensaje->getIdUsuario()) {
$value = "<li class=\"float-left\">";
$value .= button_to(__('Borrar completamente'), 'mensajes/delete_salida?id_mensaje=' . $mensaje->getPrimaryKey(), array('post' => true, 'confirm' => __('¿Quiere borrar este mensaje? También se borrarán las copias enviadas a los destinatarios'), 'class' => 'sf_admin_action_delete'));
$value .= "</li>\n";
$mensaje_destino = MensajeDestinoPeer::retrieveByPk($mensaje->getPrimaryKey(), $usuario->getPrimaryKey());
if (isset($mensaje_destino)) {
$value .= "<li class=\"float-left\">";
$value .= button_to(__('borrar copia recibida'), 'mensajes/delete_entrada?id_mensaje=' . $mensaje->getPrimaryKey(), array('post' => true, 'confirm' => __('¿Quiere borrar esta copia? El mensaje original se mantendrá intacto'), 'class' => 'sf_admin_action_delete'));
$value .= "</li>\n";
}
} else {
$value = "<li class=\"float-left\">";
$value .= button_to(__('Borrar'), 'mensajes/delete_entrada?id_mensaje=' . $mensaje->getPrimaryKey(), array('post' => true, 'confirm' => __('¿Quiere borrar este objeto?'), 'class' => 'sf_admin_action_delete'));
$value .= "</li>\n";
}
echo $value;
?>
</ul>
<?php
}
示例10: button_to
<?php
}
if ($sf_user->hasCredential(array(0 => array(0 => 'administrator', 1 => 'schemaadmin', 2 => 'agentadmin'))) && count($sf_flash->get('newUsers', array()))) {
?>
<li><?php
if ($schema_has_user->getId()) {
echo button_to(__('Add Maintainer'), 'schemauser/create', array('title' => 'Create', 'class' => 'sf_admin_action_create'));
}
?>
</li>
<?php
}
if ($sf_user->hasCredential(array(0 => array(0 => 'administrator', 1 => 'schemaadmin', 2 => 'agentadmin'))) && 1 < count($sf_flash->get('newUsers', array()))) {
?>
<li><?php
echo submit_tag(__('Save and add'), array('name' => 'save_and_add', 'title' => 'Save and add', 'class' => 'sf_admin_action_save_and_add'));
?>
</li>
<?php
}
if ($sf_user->hasCredential(array(0 => array(0 => 'administrator', 1 => 'schemaadmin', 2 => 'agentadmin', 3 => 'schemamaintainer')))) {
?>
<li><?php
echo button_to(__('Cancel'), 'schemauser/cancel?id=' . $schema_has_user->getId(), array('title' => 'Cancel', 'class' => 'sf_admin_action_cancel'));
?>
</li>
<?php
}
?>
</ul>
示例11: button_to
<?php
// auto-generated by sfPropelAdmin
// date: 2007/07/18 17:55:34
?>
<ul class="sf_admin_actions">
<li><?php
echo button_to(__('list'), 'horarioescolar/list?id=' . $horarioescolar->getId(), array('class' => 'sf_admin_action_list'));
?>
</li>
<li><?php
echo submit_tag(__('save'), array('name' => 'save', 'class' => 'sf_admin_action_save'));
?>
</li>
<li><?php
echo submit_tag(__('save and add'), array('name' => 'save_and_add', 'class' => 'sf_admin_action_save_and_add'));
?>
</li>
</ul>
示例12: __
</div>
</div>
<div class="form-row">
<label for="filters_created_at"><?php
echo __('Data adesione:');
?>
</label>
<div class="content">
<?php
echo input_date_range_tag('filters[created_at]', isset($filters['created_at']) ? $filters['created_at'] : null, array('rich' => true, 'withtime' => true, 'calendar_button_img' => '/sf/sf_admin/images/date.png'));
?>
</div>
</div>
</fieldset>
<ul class="sf_admin_actions">
<li><?php
echo button_to(__('reset'), 'premiumdemo/list?filter=filter', 'class=sf_admin_action_reset_filter');
?>
</li>
<li><?php
echo submit_tag(__('filter'), 'name=filter class=sf_admin_action_filter');
?>
</li>
</ul>
</form>
</div>
示例13: object_input_date_tag
<?php
echo object_input_date_tag($rel_calendariovacunacion_alumno, 'getFecha', array('rich' => true, 'withtime' => true, 'calendar_button_img' => sfConfig::get('sf_admin_web_dir') . '/images/date.png', 'control_name' => 'rel_calendariovacunacion_alumno[fecha]'));
?>
</div>
</div>
</fieldset>
<?php
echo include_partial('edit_actions', array('rel_calendariovacunacion_alumno' => $rel_calendariovacunacion_alumno));
?>
</form>
<ul class="sf_admin_actions">
<li class="float-left"><?php
if ($rel_calendariovacunacion_alumno->getId()) {
echo button_to(__('delete'), 'relCalendariovacunacionAlumno/delete?id=' . $rel_calendariovacunacion_alumno->getId(), array('post' => true, 'confirm' => __('Are you sure?'), 'class' => 'sf_admin_action_delete'));
}
?>
</li>
</ul>
</div>
<div id="sf_admin_footer">
<?php
include_partial('relCalendariovacunacionAlumno/edit_footer', array('rel_calendariovacunacion_alumno' => $rel_calendariovacunacion_alumno));
?>
</div>
示例14: __
echo __('Save');
?>
" name="btnSave" id="submitSave"/>
<input type="button" class="" id="btnAddRow" value="<?php
echo __('Add Row');
?>
" name="btnAddRow">
<input type="button" class="delete" id="submitRemoveRows" value="<?php
echo __('Remove Rows');
?>
" name="btnRemoveRows">
<?php
echo button_to(__('Reset'), 'time/editTimesheet?timesheetId=' . $timesheetId . '&employeeId=' . $employeeId . '&actionName=' . $backAction, array('class' => 'reset', 'id' => 'btnReset'));
?>
<?php
echo button_to(__('Cancel'), 'time/' . $backAction . '?timesheetStartDate=' . $startDate . '&employeeId=' . $employeeId, array('class' => 'reset', 'id' => 'btnBack'));
?>
</p>
</div>
</form>
</div> <!-- inner -->
</div> <!-- Box -->
<?php
echo $listForm;
?>
<!-- comment-Dialog -->
<div class="modal hide" id="commentDialog">
<div class="modal-header">
示例15: button_to
<?php
// auto-generated by sfPropelAdmin
// date: 2007/05/02 17:35:40
?>
<ul class="sf_admin_actions">
<li><?php
echo button_to(__('create'), 'relDivisionActividadDocente/create', array('class' => 'sf_admin_action_create'));
?>
</li>
<li><?php
echo button_to(__('exportar'), 'relDivisionActividadDocente/exportToIcal', array('class' => ''));
?>
</li>
<li><?php
echo button_to(__('ver calendario'), 'relDivisionActividadDocente/verCalendario', array('class' => ''));
?>
</li>
</ul>