【发布时间】:2014-04-23 09:23:01
【问题描述】:
整个晚上都在寻找,这一切看起来都那么简单,但就是行不通!
刚开始并尝试将变量放入视图中。
无论我做什么,我似乎都看不懂。
routes.php:
Route::get('/', function()
{
return View::make('dashboard');
});
View::composer('dashboard', function($view) {
$view->with('links', "something");
});
dashboard.blade.php:
@extends('base_view')
@section('content')
All the stuff!
{{links}}
@stop
base_view.blade.php
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Laravel PHP Framework</title>
</head>
<body>
<div>TeamPro</div>
<div>@yield('content')</div>
</body>
</html>
请告诉我我只是在做一些愚蠢的事情!
【问题讨论】:
标签: php laravel laravel-4 blade