继承在伏特模板中不起作用的接缝。
Phalcon 版本是 0.6.1
有一个文件结构:
- 意见/
- 指数/
- 索引.html
 
 - 布局/
- main.html
 
 
 - 指数/
 - 索引.php
 
索引.php:
<?php
    $di = new Phalcon\DI\FactoryDefault();
    $di->set('volt', function ($view, $di){
        return new Phalcon\Mvc\View\Engine\Volt($view, $di);
    });
    $view = new \Phalcon\Mvc\View();
    $view->setViewsDir("views/");
    $view->registerEngines(array(
        ".html" => 'volt'
    ));
    $view->setDi($di);
    $view->start();
    $view->render("index", 'index');
    $view->finish();
    echo $view->getContent();
意见/索引/index.html
{% extends "layouts/main.html" %}
{% block content %}
    <h2>Index</h2>
{% endblock %}
视图/布局/main.html
<h1>Main</h1>
{% block content %}
    Not index
{% endblock %}
当我跑步时,php index.php我得到:
未捕获的异常 'Phalcon\Mvc\View\Exception' 带有消息'扩展'layouts/main.html'的模板视图不存在'