当前位置: 首页>>代码示例>>PHP>>正文


PHP button_to函数代码示例

本文整理汇总了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';
开发者ID:Phennim,项目名称:symfony1,代码行数:31,代码来源:UrlHelperTest.php

示例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 : "&nbsp;";
?>
    </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>
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:30,代码来源:_filters.php

示例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'));
?>
开发者ID:silky,项目名称:littlesis,代码行数:31,代码来源:_map_and_controls.php

示例4: button_to

<ul class="sf_admin_actions">
      <li><?php 
echo button_to(__('create'), 'informes/create', array('class' => 'sf_admin_action_create'));
?>
</li>
  </ul>
开发者ID:mediasadc,项目名称:alba,代码行数:6,代码来源:_list_actions.php

示例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 {
    ?>
&nbsp;
<?php 
}
?>
</ul>
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:24,代码来源:_list_actions.php

示例6: __

echo $value ? $value : '&nbsp;';
?>
  <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 
}
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:31,代码来源:_edit_form.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>
开发者ID:silky,项目名称:littlesis,代码行数:30,代码来源:editAddressSuccess.php

示例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 
}
开发者ID:psskhal,项目名称:symfony-sample,代码行数:31,代码来源:Copy+of+buySuccess.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 
}
开发者ID:Esleelkartea,项目名称:legedia-ESLE,代码行数:31,代码来源:_edit_form.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>
开发者ID:jonphipps,项目名称:Metadata-Registry,代码行数:30,代码来源:_edit_actions.php

示例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>
开发者ID:mediasadc,项目名称:alba,代码行数:19,代码来源:_edit_actions.php

示例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>
开发者ID:valerio-bozzolan,项目名称:openparlamento,代码行数:30,代码来源:_filters.php

示例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>
开发者ID:mediasadc,项目名称:alba,代码行数:30,代码来源:editSuccess.php

示例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">
开发者ID:lahirwisada,项目名称:orangehrm,代码行数:31,代码来源:editTimesheetSuccess.php

示例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>
开发者ID:mediasadc,项目名称:alba,代码行数:22,代码来源:_list_actions.php


注:本文中的button_to函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。