第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何將值從輸入文本框傳遞到拉拉維爾中的另一個頁面

如何將值從輸入文本框傳遞到拉拉維爾中的另一個頁面

PHP
郎朗坤 2022-09-17 21:37:24
索引控制器如下所示<?phpnamespace App\Http\Controllers;use Illuminate\Http\Request;class IndexController extends Controller{    public function index()    {        return view('welcome');    }    public function about()    {        return view('about');    }  public function contact()  {    return view('contact');  }  public function thanks(Request $request)  {    $request->validate(['firstname' => ['required', 'alpha_num']]);    return view('thanks');  }}接觸刀片.php在下面@extends('welcome')@section('content')          <div>            <h2>Contact Page</h2>            <form method="post" action="{{route("thanks")}}">              @csrf<input type="text" name="firstname"/>              <input type="submit"/>            </form>            @if ($errors->any())            <div class="alert alert-danger">              <ul>                @foreach ($errors->all() as $error)                <li>{{ $error }}</li>                    @endforeach              </ul>            </div>                @endif                  </div>  @endsection謝謝刀片.php@extends('welcome')@section('content')<div>  <h2>Thanks</h2>Thank you {{ $firstname }}</div>@endsection歡迎刀片.php  <div class="flex-center position-ref full-height">            <div class="content">                <div class="title m-b-md">                    app                </div>                <div class="links">                    <a href="{{ route('about')  }}">About</a>                    <a href="{{ route('contact')  }}">contact</a>                </div>                <h1>{{$firstname}}</h1>                <div>                    @yield('content')                </div>            </div>        </div>當我在 welcome.blade 中單擊“聯(lián)系人”時.php它會將我?guī)У健奥?lián)系人”頁面,其中文本框是按壓的 。輸入的值應(yīng)顯示在“謝謝”.php中。我需要在文本框中輸入的值顯示在感謝.blade中.php當我單擊提交時。提前致謝
查看完整描述

1 回答

?
largeQ

TA貢獻2039條經(jīng)驗 獲得超8個贊

數(shù)據(jù)需要顯式傳遞到視圖。出于希望顯而易見的原因,它不能作為變量在全球范圍內(nèi)訪問。

例如

return view('thanks', ['firstname' => 'Your First Name']);


查看完整回答
反對 回復(fù) 2022-09-17
  • 1 回答
  • 0 關(guān)注
  • 132 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號