ユーザ用ツール

サイト用ツール


サイドバー

プログラム言語:php:laravel:フォーム

文書の過去の版を表示しています。


【Laravel】フォームの書き方

Form ファサード

blade テンプレートでの Form ファサードを使った書き方。
参考 http://recipes.laravel.jp/category/17

フォームタグ

# 基本の書き方
{{ Form::open() }}
{{ Form::close() }}

# URL 指定
{{ Form::open(['url' => 'http://example.com']) }}

# ルーティング指定
{{ Form::open(['route' => 'home.index']) }}

# コントローラ指定
{{ Form::open(['action' => 'Controller@method']) }}

# GET 送信
{{ Form::open(['method' => 'get']) }}

# ファイルアップロード
{{ Form::open(['files' => true]) }}

未整理:そのうち書く

# テキスト
{{ Form::text('name', null, ['class' => 'cssクラス名') }}

# テキストエリア
{{ Form::textarea('note', null, ['class' => 'cssクラス名', 'rows' => '5']) }}

# セレクトボックス
{{ Form::select('pref', $pref_list, null, ['class' => 'cssクラス名']) }}
{{ Form::select('area', ['東日本', '西日本'], null, ['class' => 'cssクラス名']) }}

# チェックボックス
{{ Form::checkbox('hobby[]', '映画', null, ['class' => 'cssクラス名']) }}

コメント

コメントを入力. Wiki文法が有効です:
 
プログラム言語/php/laravel/フォーム.1579229051.txt.gz · 最終更新: 2020/01/17 11:44 by humolife