# 實現自定義的 HTML 頁面 ###### tags: `laravel`, `dcat-admin` ## 情境 我們有時候因為業務邏輯的複雜性,導致 Dcat Admin 的數據表單功能不敷使用,當然你可以選擇自己自定義的客製化,但我們也不希望失去側選單與上方選單功能,因此我們可以使用 **Dcat\Admin\Layout\Content** 類別中裡面的 **body** 功能進行客製化 ### 效果圖  ## 程式碼 ### 後端 Controller ```php <?php namespace App\Admin\Controllers; use Dcat\Admin\Form; use Dcat\Admin\Layout\Content; class WebSiteController { public function index(Content $content) { $iconUploadHtml = Form::make()->file('icon')->render(); $config = (object) [ 'title' => '你好世界', ]; return $content->header('網站基本資訊管理') ->description('編輯網站基本資訊') ->with(['websiteSetting' => $config,'iconUploadHtml' => $iconUploadHtml]) ->body(view('admin.website.index',[])); // 在這裡把你想要的 view 丟進來 } } ``` ### 前端 admin.website.index ```php 輸入欄位顯示 <textarea class="form-control"></textarea> ``` ## 參考文件 [開發前必讀](https://learnku.com/docs/dcat-admin/2.x/required-reading-before-development/8083)
×
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