donglun1020 2017-01-19 12:10
浏览 93
已采纳

Laravel传递多个变量来查看

Learning through some videos for Laravel but hit an issue i cant seem to figure out.

I have a route

Route::get('/post/{id}/{name}/{password}', 'PostController@showPost');

A custom controller called PostController.php

public function showPost($id, $name, $password) {
        return view('post', compact('id','name','password'));
    }

and the view called post.blade.php

<div class="container">
    <h1>Post {{$id}} {{$name}} {{$password}}</h1>
</div>

when running the url

http://127.0.0.1/post/1/2/3

I get back a 404 page.

  • 写回答

1条回答 默认 最新

  • dousongqiang2585 2017-01-19 12:20
    关注

    Looks like you need to allow .htaccess files. The problem is your routes aren't working.

    https://help.ubuntu.com/community/EnablingUseOfApacheHtaccessFiles

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 mmocr的训练错误,结果全为0
  • ¥15 python的qt5界面
  • ¥15 无线电能传输系统MATLAB仿真问题
  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀