配置视图组件

    • 为何会自动注册

    :) 请参考: ,以及前面的 组件

    • 视图组件注册到容器里的名称为: view
    • 基本配置(file: config/beans/base.php)
    • viewsPath 视图存放路径
    • suffix 默认的视图后缀(默认是 )
    • suffixes 允许的视图后缀列表。 用于判断是否需要添加默认后缀
    • placeholder 在布局文件里使用的内容占位符。 默认 {_CONTENT_}

    引入其他视图文件

    在视图文件里包含其他视图文件,可以使用:

    • include(string $view, array $data, bool $outputIt = true)
    • fetch(string $view, array $data)

    注意:

    1. <div class="container">
    2. <!-- Content here -->
    3. <div id="page-content" style="padding: 15px 0;">{_CONTENT_}</div>
    4. <?php $this->include('layouts/default/footer') ?>
    5. </div>