配置视图组件
- 为何会自动注册
:) 请参考: ,以及前面的 组件
- 视图组件注册到容器里的名称为:
view
- 基本配置(file:
config/beans/base.php
)
viewsPath
视图存放路径suffix
默认的视图后缀(默认是 )suffixes
允许的视图后缀列表。 用于判断是否需要添加默认后缀placeholder
在布局文件里使用的内容占位符。 默认{_CONTENT_}
引入其他视图文件
在视图文件里包含其他视图文件,可以使用:
include(string $view, array $data, bool $outputIt = true)
fetch(string $view, array $data)
注意:
<div class="container">
<!-- Content here -->
<div id="page-content" style="padding: 15px 0;">{_CONTENT_}</div>
<?php $this->include('layouts/default/footer') ?>
</div>