I'm trying to load a template in PhalconPHP (v 2.0.13), but even the simplest example doesn't seem to work. I'm trying to access http://www.mysite.dev.fb/forms/ in this example. Here is my router:
$router->add(
'/forms/',
[
"namespace" => "Render\\Controller",
"controller" => "index",
"action" => "forms",
],
['GET']
);
The routing works, or at least the code in the action is reached (vardumps, etc).
Here's my Controller action variants.
Variant 1
public function formsAction()
{
}
In this case, the template located at app/views/index/forms.volt (I have a copy of the file with an .phtml extension, for debugging purposes) should be loaded, right? Wrong, an empty screen is displayed, no errors in errorlog.
Variant 2
Then, I tried picking the view, like that:
$this->view->setViewsDir(__DIR__ . '/../views/');
$this->view->pick('forms/contact');
The file, app/views/forms/contact.volt, also exists, with full permissions. Vardumping $this->view->getContent() returns null and the result is again an empty white screen without any errors.
Variant 3
Desperately, I tried directly rendering the template (for this example I'm using the default Phalcon index/index template) like this:
$this->view->start();
$this->view->render('index', 'index'); //Pass a controller/action as parameters if required
$this->view->finish();
The only difference is that now vardumping $this->view->getContent() returns an empty string, instead of null.
It's like automatic rendering is disabled, but the following line returns false (as it should):
var_dump($this->view->isDisabled());
I'm out of ideas, can anyone help? If I forgot to include something, respond and I'll include it.