Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

What is the difference between volt files and phtml files?

What is the difference between volt files and phtml files?



3.6k
Accepted
answer

phtml is a template engine uses raw php,

example in phtml:

<?php echo $this->tag->form('/login'); ?>
    <?php echo $form->render('email'); ?>
<?php echo $tihs->tag->endForm(); ?>

volt is a template engine uses volt syntax (support also raw php):

example in volt:

{{ form('/login') }}
    {{ form.render('email') }}
{{ endform() }}

More about volt: http://docs.phalconphp.com/en/latest/reference/volt.html

You can configure Phalcon to treat both of them identically. All my template files have a .phtml extension. but I use Volt syntax in them.

i can use volt template .volt extension, and use php syntax ? is the same?