Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitebba497

Browse files
authored
Merge pull requestyajra#45 from ElfSundae/post-ajax
Add postAjax() to Html Builder.
2 parents970ed8b +f14d74c commitebba497

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

‎src/Html/Builder.php‎

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -503,6 +503,25 @@ public function ajax($attributes = '')
503503
return$this;
504504
}
505505

506+
/**
507+
* Setup "ajax" parameter with POST method.
508+
*
509+
* @param string|array $attributes
510+
* @return $this
511+
*/
512+
publicfunctionpostAjax($attributes ='')
513+
{
514+
if (!is_array($attributes)) {
515+
$attributes = ['url' => (string)$attributes];
516+
}
517+
518+
unset($attributes['method']);
519+
Arr::set($attributes,'type','POST');
520+
Arr::set($attributes,'headers.X-HTTP-Method-Override','GET');
521+
522+
return$this->ajax($attributes);
523+
}
524+
506525
/**
507526
* Generate DataTable's table html.
508527
*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp