0
我对laravel很新。这条路线是:在laravel中使用参数化函数
Route::get('/imagess','[email protected]');
Route::get('/imagess/details/{id}','[email protected]_details');
控制文件中的函数是:
public function imagess() {
return view('imagess');
}
public function image_details($id) {
return view('image_details');
}
视图文件是imagess.blade.php
@extends('inside.main')
@section('content')
<img src="{{asset('images/play.png')}}" height="100px" width="100px"><a href="{{url('imagess/details/1')}}">View image 1</a><br>
<img src="{{asset('images/eat.png')}}" height="100px" width="100px"><a href="{{url('imagess/details/2')}}">View image 2</a><br>
<img src="{{asset('images/sleep.png')}} height="10px" width="10px""><a href="{{url('imagess/details/3')}}">View image 3</a><br>
tihsajf
<img src="{{asset('images/read.png')}}" height="100px" width="100px"><a href="{{url('imagess/details/4')}}">View image 4</a><br>
@endsection
应该是什么我imagess_details.blade.php
显示每个基本细节这些图像?我不是想用数据库来显示确切的细节。只显示任何东西。例如。显示'你好',如果我点击image1,'begineer',如果我点击image2,'这里'如果我点击image3等等..
如果我让images_details
如下。它显示'你好',我是否点击image1,image2或任何其他图像。
@extends('inside.main')
@section('content')
<h2>hello</h2>
@endsection
为什么“imagess”有两个“S”,为什么你不使用StudlyCased名称作为控制器和动作名称? –
'images_details'将始终显示“Hello”,因为它的静态?您需要将您的控制器中的某些内容传递给视图。 – Wancieho
如果我的答案是有帮助的,请upvote并选择它作为最佳答案。 –