本文整理汇总了PHP中Toolbar::addButton方法的典型用法代码示例。如果您正苦于以下问题:PHP Toolbar::addButton方法的具体用法?PHP Toolbar::addButton怎么用?PHP Toolbar::addButton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Toolbar
的用法示例。
在下文中一共展示了Toolbar::addButton方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: defined
<?php
defined('_EXE') or die('Restricted access');
?>
<?php
Toolbar::addTitle("Parrilla", "glyphicon-star");
//Export button
Toolbar::addButton(array("title" => "Exportar", "app" => "parrilla", "action" => "export", "class" => "primary", "spanClass" => "share-alt", "noAjax" => true));
Toolbar::render();
?>
<form method="post" name="mainForm" id="mainForm" action="<?php
echo Url::site();
?>
" class="form-horizontal" role="form" autocomplete="off">
<input type="hidden" name="app" id="app" value="parrilla">
<input type="hidden" name="action" id="action" value="export">
<div class="form-group">
<label for="fecha" class="col-sm-2 control-label">
Fecha
</label>
<div class="col-sm-3">
<input type="text" name="fecha" class="form-control" id="fecha" value="<?php
echo date("d-m-Y");
?>
" placeholder="Fecha">
</div>
<div class="col-sm-3">
<input type="text" name="hour" class="form-control hourMask" id="hour" value="07:00" placeholder="Hora">
示例2: defined
<?php
defined('_EXE') or die('Restricted access');
?>
<?php
//Toolbar
Toolbar::addTitle("Entradas", "glyphicon-star", "Listar");
//New button
Toolbar::addButton(array("title" => "Nueva", "app" => "entradas", "action" => "edit", "class" => "success", "spanClass" => "plus", "noAjax" => true));
Toolbar::render();
?>
<div class="main">
<form method="post" action="<?php
echo Url::site();
?>
" id="mainForm" name="mainForm" class="form-inline" role="form">
<input type="hidden" name="fresh" value="true">
<input type="hidden" name="app" id="app" value="entradas">
<input type="hidden" name="action" id="action" value="">
<!-- Filters -->
<div class="row filters">
<!-- Search -->
<div class="col-sm-3 col-xs-6 filter">
<?php
echo Html::search();
?>
</div>
<!-- Vinculado -->
<div class="col-sm-3 col-xs-6 filter">
示例3:
if ($user->id) {
$subtitle = "Editar usuario";
$title = "Guardar";
} else {
$subtitle = "Nuevo usuario";
$title = "Crear";
}
Toolbar::addTitle("Usuarios", "glyphicon-user", $subtitle);
if ($user->id) {
//Delete button
Toolbar::addButton(array("title" => "Eliminar", "app" => "users", "action" => "delete", "class" => "danger", "spanClass" => "remove", "confirmation" => "¿Deseas realmente eliminar este usuario?", "noAjax" => true));
}
//Cancel button
Toolbar::addButton(array("title" => "Cancelar", "link" => Url::site("users"), "class" => "primary", "spanClass" => "chevron-left"));
//Save button
Toolbar::addButton(array("title" => $title, "app" => "users", "action" => "save", "class" => "success", "spanClass" => "ok"));
Toolbar::render();
?>
<form method="post" name="mainForm" id="mainForm" action="<?php
echo Url::site();
?>
" class="form-horizontal ajax" role="form" autocomplete="off">
<input type="hidden" name="app" id="app" value="users">
<input type="hidden" name="action" id="action" value="save">
<input type="hidden" name="id" value="<?php
echo $user->id;
?>
">
<div class="row">
<div class="col-md-12">
示例4:
$title = "Guardar";
} else {
$subtitle = "Nueva entrada";
$title = "Crear";
}
Toolbar::addTitle("Entradas", "glyphicon-star", $subtitle);
if ($entrada->id) {
//Delete button
Toolbar::addButton(array("title" => "Eliminar", "app" => "entradas", "action" => "delete", "class" => "danger", "spanClass" => "remove", "confirmation" => "¿Deseas realmente eliminar esta entrada?", "noAjax" => true));
}
//Cancel button
Toolbar::addButton(array("title" => "Cancelar", "link" => Url::site("entradas"), "class" => "primary", "spanClass" => "chevron-left"));
//Save button
Toolbar::addButton(array("title" => $title, "app" => "entradas", "action" => "save", "class" => "success", "spanClass" => "ok"));
//Save & new button
Toolbar::addButton(array("title" => $title . " y nueva", "app" => "entradas", "action" => "saveNew", "class" => "success", "spanClass" => "ok"));
Toolbar::render();
?>
<form method="post" name="mainForm" id="mainForm" action="<?php
echo Url::site();
?>
" class="form-horizontal ajax" role="form" autocomplete="off">
<input type="hidden" name="app" id="app" value="entradas">
<input type="hidden" name="action" id="action" value="save">
<input type="hidden" name="id" value="<?php
echo $entrada->id;
?>
">
<div class="row">
<div class="col-md-12">