测试路由
Route::get('/', function(){ $value = [1,2,3]; return view('home.index', array('data' => $value));});
views下面的目录结构
/Applications/MAMP/htdocs/testApp/resources/viewsmac:views mmc$ tree.
├── home
│ └── index.blade.php ├── mylayout │ └── test_layout.blade.php
index.blade.php
@extends('mylayout.test_layout')@section('aaa') @stop
test_layout.blade.php
asdasdasd @yield('aaa')
如果你的views目录下有子目录,模板放子目录里面的话,比如
.├── backend│ ├── a.blade.php│ ├── b.blade.php
a为模板,则b里面的extends需要
@extends('backend.a')