--- title: 內容與布局 tags: Laravel-Admin --- 1. 後臺布局文件- HomeController.php的index()方法 * 使用```Content::body($content)```來添加頁面內容 * 代碼講解 ``` public function index(Content $content) { // 選填 $content->title('頁頭標題'); // 選填 $content->description('描述小標題'); // 麵包屑導航 since v1.5.7 $content->breadcrumb( ['text' => '首頁', 'url' => '/admin'], ['text' => '用户管理', 'url' => '/admin/users'], ['text' => '編輯用户'] ); // 填充頁面body部分,這裡可以填入任何可被渲染的對象 $content->body('hello world'); // 在body中添加另一段内容 $content->body('foo bar'); // `row`是`body`方法的别名 $content->row('hello world'); // 直接渲染視圖輸出,Since v1.6.12 $content->view('dashboard', ['data' => 'foo']); return $content; } ``` 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up