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


PHP Form::submit方法代码示例

本文整理汇总了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;
}
开发者ID:sonusbeat,项目名称:soundcore,代码行数:15,代码来源:Helpers.php

示例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;
 }
开发者ID:Ravend6,项目名称:laravel_base_v5.2,代码行数:7,代码来源:functions.php

示例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;
}
开发者ID:yokotakaoru,项目名称:international_sys,代码行数:7,代码来源:helper.php

示例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;
 }
开发者ID:sorora,项目名称:empower,代码行数:12,代码来源:Empower.php

示例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;
}
开发者ID:namoosshah,项目名称:basketball,代码行数:13,代码来源:helpers.php

示例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('&#xf1f8; ' . trans('admin.ops.delete'), ['onclick' => "return confirm('" . trans('admin.ops.confirmation') . "');", 'class' => $delete_class]);
     $ops .= Form::close();
     $ops .= '</li>';
     $ops .= '</ul>';
     return $ops;
 }
开发者ID:binhbeer,项目名称:laravel-5-simple-cms,代码行数:37,代码来源:AdminHelper.php

示例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;
 }
开发者ID:Ravend6,项目名称:laravel_learn,代码行数:7,代码来源:functions.php

示例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');
 }
开发者ID:spelgrift,项目名称:imageman,代码行数:27,代码来源:login_model.php

示例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.');
 }
开发者ID:Selwyn-b,项目名称:elefant,代码行数:16,代码来源:FormTest.php

示例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();
}
开发者ID:CCRRAABB,项目名称:laravel_try1,代码行数:7,代码来源:functions.php

示例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();
 }
开发者ID:srueegger,项目名称:1zu12bB,代码行数:25,代码来源:translationeditor.php

示例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;
 }
开发者ID:ratiw,项目名称:petro,代码行数:8,代码来源:groups.php

示例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();
 }
开发者ID:gabitoooo,项目名称:inventarios,代码行数:13,代码来源:UserController.php

示例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>';
 }
开发者ID:rowena-altastratus,项目名称:altastratus,代码行数:11,代码来源:sandbox.admin.php

示例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();
 }
开发者ID:nkwsy,项目名称:ParkingAppeal,代码行数:8,代码来源:user.php


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