本文整理汇总了PHP中Form::submit方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::submit方法的具体用法?PHP Form::submit怎么用?PHP Form::submit使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Form
的用法示例。
在下文中一共展示了Form::submit方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: delete_resource
/**
* Eliminar el recurso por id ó index
*
* @param string $route
* @param mixed $resource
* @param string $label
* @return Callable
*/
function delete_resource($routeParams = [], $label = 'Eliminar')
{
$form = Form::open(['route' => $routeParams, 'method' => 'delete', 'class' => 'inline', 'id' => 'delete']);
$form .= Form::submit($label, ['class' => 'btn btn-danger']);
$form .= Form::close();
return $form;
}
示例2: delete_to_route_with_lang
function delete_to_route_with_lang($params)
{
$form = Form::open(['route' => $params, 'method' => 'delete']);
$form .= Form::submit(trans('messages.button_delete'), ['class' => 'btn btn-danger btn-sm', 'onclick' => 'return confirm("' . trans('messages.delete_confirm') . '");']);
$form .= Form::close();
return $form;
}
示例3: delete_form
function delete_form($urlParams, $label = '削除')
{
$form = Form::open(['method' => 'DELETE', 'url' => $urlParams]);
$form .= Form::submit($label, ['class' => 'btn btn-danger']);
$form .= Form::close();
return $form;
}
示例4: buttonDestroy
/**
* Button generator for buttons used for @destroy actions
*
* @return string
*/
public function buttonDestroy($route, $extra)
{
$button = $this->open('destroy', $route, $extra);
$button .= \Form::submit('Delete');
$button .= \Form::close();
return $button;
}
示例5: deleteForm
/**
* Delete form
* @param $params
* @param string $label
* @return string
*/
function deleteForm($params, $label = 'Delete')
{
$html = Form::open(['method' => 'DELETE', 'route' => $params, 'class' => 'delete-form']);
$html .= Form::submit($label, ['class' => 'btn btn-danger btn-delete']);
$html .= Form::close();
return $html;
}
示例6: get_ops
/**
* Returns resource operations for the datatables or nested sets
*
* @param $resource
* @param $id
* @param $class
* @return string
*/
function get_ops($resource, $id, $class = "btn")
{
if ($class == "btn") {
$show_class = "btn btn-xs bg-navy";
$edit_class = "btn btn-xs bg-olive";
$delete_class = "btn btn-xs btn-danger destroy";
} else {
$show_class = "inline-show";
$edit_class = "inline-edit";
$delete_class = "inline-delete";
}
$show_path = route('admin.' . $resource . '.show', ['id' => $id]);
$edit_path = route('admin.' . $resource . '.edit', ['id' => $id]);
$delete_path = route('admin.' . $resource . '.destroy', ['id' => $id]);
$ops = '<ul class="list-inline no-margin-bottom">';
$ops .= '<li>';
$ops .= '<a class="' . $show_class . '" href="' . $show_path . '"><i class="fa fa-search"></i> ' . trans('admin.ops.show') . '</a>';
$ops .= '</li>';
$ops .= '<li>';
$ops .= '<a class="' . $edit_class . '" href="' . $edit_path . '"><i class="fa fa-pencil-square-o"></i> ' . trans('admin.ops.edit') . '</a>';
$ops .= '</li>';
$ops .= '<li>';
$ops .= Form::open(['method' => 'DELETE', 'url' => $delete_path]);
$ops .= Form::submit(' ' . trans('admin.ops.delete'), ['onclick' => "return confirm('" . trans('admin.ops.confirmation') . "');", 'class' => $delete_class]);
$ops .= Form::close();
$ops .= '</li>';
$ops .= '</ul>';
return $ops;
}
示例7: delete_to_route
function delete_to_route($routeName, $id)
{
$form = Form::open(['route' => [$routeName, $id], 'method' => 'delete']);
$form .= Form::submit(Message::DELETE_BUTTON, ['class' => 'btn btn-danger', 'onclick' => 'return confirm("' . Message::DELETE_CONFIRM . '");']);
$form .= Form::close();
return $form;
}
示例8: run
public function run($static = false)
{
$form = new Form();
$form->post('login')->val('blank')->post('password')->val('blank');
if (!$form->submit()) {
// Error
$this->_error($static);
return false;
}
$data = $form->fetch();
$login = $data['login'];
$password = Hash::create('sha256', $data['password'], PASS_HASH_KEY);
$query = "SELECT userid, login, role FROM user WHERE login = :login AND password = :password";
if (!($result = $this->db->select($query, array(':login' => $login, ':password' => $password)))) {
$this->_error($static);
return false;
}
Session::init();
Session::set('userid', $result[0]['userid']);
Session::set('login', $result[0]['login']);
Session::set('role', $result[0]['role']);
Session::set('loggedIn', true);
if ($static) {
header('location:' . URL . 'dashboard');
}
echo json_encode('success');
}
示例9: Form
function test_submit()
{
$_SERVER['REQUEST_METHOD'] = 'POST';
$_SERVER['HTTP_HOST'] = 'www.test.com';
$_SERVER['HTTP_REFERER'] = 'http://www.test.com/app/foo';
$form = new Form('post');
$this->assertEquals($form->method, 'post');
$this->assertEquals($form->rules, array());
$this->assertFalse($form->submit());
$this->assertEquals($form->error, 'Cross-site request forgery detected.');
$form->verify_csrf = false;
$this->assertTrue($form->submit());
$_SERVER['HTTP_REFERER'] = 'http://www.other.com/foo.bar';
$this->assertFalse($form->submit());
$this->assertEquals($form->error, 'Referrer must match the host name.');
}
示例10: delete_form
function delete_form($routeParams, $label = 'Delete')
{
$form = Form::open(['method' => 'DELETE', 'action' => $routeParams]);
//dd($form);
$form .= Form::submit($label, ['class' => 'btn btn-danger']);
return $form .= Form::close();
}
示例11: display
public function display()
{
$form = new Form(2);
$form->submit();
$GLOBALS['editinglanguage'] = new Language($_GET['language']);
$table = new Table();
$token = new TableColumn("token", "Token");
$translation = new TableFunctionColumn("token", Language::DirectTranslate("TRANSLATION"));
$translation->functionName = "TranslationEditor_GetString";
$translation->autoWidth = true;
$languagetoken = new TableColumn("'" . DataBase::Current()->EscapeString($_GET['language']) . "' as language", "Language");
$languagetoken->value = $_GET['language'];
$languagetoken->visible = false;
$table->columns->add($token);
$table->columns->add($translation);
$table->columns->add($languagetoken);
$table->name = "{'dbprefix'}language_tokens";
$table->actions = "translation_tokens";
$table->orderBy = "token";
$table->size = -1;
$table->display();
$newModule = Language::DirectTranslateHtml("NEW_MODULE");
echo "<h2>" . $newModule . "</h2>";
$form->display();
}
示例12: setup_form
protected function setup_form()
{
$form = new Petro_Form();
$form->add_model('Model_Group');
$form->add_form_action(\Form::submit('submit', 'Submit', array('class' => 'btn btn-primary')));
$form->add_form_action(\Html::anchor('groups', 'Cancel', array('class' => 'btn')));
return $form;
}
示例13: index
/**
* Display a listing of the resource.
*
* @return Response
*/
public function index()
{
echo Form::open(array('url' => 'l/ingreso', 'method' => 'post'));
echo Form::text('username');
echo Form::text('password');
echo Form::submit('enviar');
echo Form::close();
}
示例14: formComponent
/**
* Form Component
*/
public static function formComponent()
{
$_templates = Themes::getTemplates();
foreach ($_templates as $template) {
$templates[basename($template, '.template.php')] = basename($template, '.template.php');
}
echo '<div class="col-xs-3">' . Form::open() . Form::hidden('csrf', Security::token()) . Form::label('sandbox_form_template', __('Sandbox template', 'sandbox')) . Form::select('sandbox_form_template', $templates, Option::get('sandbox_template'), array('class' => 'form-control')) . Html::br() . Form::submit('sandbox_component_save', __('Save', 'sandbox'), array('class' => 'btn btn-default')) . Form::close() . '</div>';
}
示例15: get_login
public function get_login()
{
echo "Hello! Welcome to the login page!";
echo Form::open('user/login', 'POST');
echo Form::text('username');
echo Form::submit('Click Me!');
echo Form::close();
}