We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 here.

How to use volt instead of phtml in the view of example tutorial 1?I tried but it doesn't work. why?

Hi guys, I have a question: How to use volt instead of phtml in the view of example tutorial 1? http://docs.phalcon.io/en/latest/reference/tutorial.html#creating-a-project

Official phtml code is



echo "<h1>Hello!</h1>";

echo Phalcon\Tag::linkTo("signup", "Sign Up Here!");

I tried to modify the sufix to volt and change the code as below. But it doesn' t work.


{{ content() }}
{{ link_to("signup", "Sign Up Here!") }}

What more, I copied the asset from project invo to tutorial 1, the same hierarchical relationship as invo.


I just modified some css, such as <h1>. But it doesn' t work either.To me I think this file(tutorial/app/view/index.volt) controls the UI,right?


<!DOCTYPE html>
        <meta charset="utf-8">
        {{ get_title() }}
        {{ stylesheet_link('bootstrap/css/bootstrap.css') }}
        {{ stylesheet_link('bootstrap/css/bootstrap-responsive.css') }}
        {{ stylesheet_link('css/style.css') }}
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="description" content="Your invoices">
        <meta name="author" content="Phalcon Team">
        {{ content() }}
        {{ javascript_include('js/jquery.min.js') }}
        {{ javascript_include('bootstrap/js/bootstrap.js') }}
        {{ javascript_include('js/utils.js') }}

invo project asset url https://github.com/phalcon/invo/tree/master/public

tutorial 1 url https://github.com/phalcon/tutorial


Did you register the Volt engine on Phalcon\Mvc\View? https://github.com/phalcon/invo/blob/master/public/index.php#L67


You can add to public/css/style.css the following:

h1 { color: red }

edited Aug '14

No, it doesn't work.