QQ扫一扫联系
通过会在 blade 模板文件中看到 @extends($_viewFrame) 来确定当前模板的框架视图,该文件通常包含公共的头部、尾部、侧边栏等内容。
$_viewFrame 会根据当前模板查找最先匹配到的文件,查找顺序参考视图渲染查找顺序。
通常情况下,该变量会按照如下顺序查找:
resources/views/theme/<主题>/pc/frame.blade.php
module/<主题模块>/View/pc/frame.blade.php
resources/views/theme/default/pc/frame.blade.php
系统约定了一些模板 @section ,在开发时候请遵守约定,以便系统能够正确的渲染模板。
@section('pageTitleMain'):系统标题,该标题后会自动补全网站主名称@section('pageKeywords'):网站关键字@section('pageDescription'):网站描述@section('bodyContent'):系统正文内容部分,不包含公共的头部、尾部、侧边栏等内容@section('body'):系统 body 标签的内容,会自动移除 body 标签中已有的内容@section('headAppend'):追加到 head 标签的内容@section('bodyAppend'):追加到 body 标签的内容以上的 section 定义用法示例如下
@section('pageTitleMain')我的视图标题@endsection
@section('pageKeywords')我的视图关键字@endsection
@section('pageDescription')我的视图描述@endsection
@section('bodyContent')
<div class="ub-container">
我的视图内容
</div>
@endsection
@section('body')
<div class="ub-container">
我的视图内容
</div>
@endsection
@section('headAppend')
<script src="xxx"></script>
@endsection
@section('bodyAppend')
<script src="xxx"></script>
@endsection