0
我有laravel應用程序。 我在我的控制器中發佈了變量$ res到我的視圖,在視圖中,我無法訪問我發佈的變量。 這裏是我的代碼:我可以訪問變量我張貼從laravel 4控制器查看
我的路線:
Route::get('/pickUpQuestion','[email protected]');
我的控制器:
public function showResult()
{
$prio = Input::get('quiz_prio');
$cat = Input::get('quiz_cat');
$les = Input::get('quiz_less');
$rdate = Input::get('date_start');
$res = DB::select("select title from quiz where categories_id='$r2' and lesson_id='$r3' and priority_id='$r1' and date_start='$rdate'");
return View::make('pickUpQuestion')->with('result',$res);
}
和我的觀點:
@extends('layouts.master')
@section('content')
<?php
var_dump($res);
?>
@stop
我把我的查詢中的值從另一個在不同的視圖中使用post方法形成該視圖