We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to specify a template engine to save files with the extension PHP to what some other place

When I start getting

/views/mytpl.phtml /views/mytpl.phtml.php

mytpl.phtml.php in my way, you can override their storage?

edited Oct '14

Sure, just set in when your register your view service:

// Setting up the view component
$di->set('view', function() use ($config) {
    $view = new Phalcon\Mvc\View();
    $view->setViewsDir($config->application->viewsDir); // HERE PATH TO DIR WHERE YOU WOLD LIKE TO STORE COMPILED TEMPLATES
    ...


11.9k

Pavlo Sadovyi, It's for installing views

I'm doing my mind and everything is together.



11.9k

Why do not you like $view->setCompilingDir ???



98.9k
Accepted
answer

Oh, sorry me... I mean "compiledDir", but copy-paste bullshit.