0
ErrorException在UrlGenerator.php线252:传递变量(途径[类别]没有定义)
路线[类别]未被定义。 (查看:d:\ XAMPP \ htdocs中\ laravel \资源\意见\网页\ home.blade.php)
Home.blade.php
$product_category = DB::table('tbl_products_category')
->select('tbl_product_category_id', 'tbl_product_category_name')
->where('tbl_product_category_status', '=', 1)
->get();
?>
@foreach($product_category as $product_category_values)
<li><a href="{{ URL::route('category', array('category_id' => $product_category_values->tbl_product_category_id)) }}"> {{ $product_category_values->tbl_product_category_name }}</a>
</li>
@endforeach
HomeController.php
<?php namespace App\Http\Controllers;
class HomeController extends Controller {
public function index()
{
return view('pages.home');
}
public function getproductDetails($category_id)
{
return $category_id;
//return view('welcome');
}
}
Route.php
Route::get('category/{category_id}', '[email protected]');