Hello,
I want the raw html beforeRender my page, because I want to put a css critical through a node service. I read this: https://docs.phalcon.io/3.4/en/api/phalcon_mvc_view, (I use 3.4) but in my example the print_r is empty... My code is this and my controller name is nombres, action is index and layout is test
public function indexAction()
{
$view = new \Phalcon\Mvc\View();
$view->setLayout("test");
$view->setViewsDir("app/views/");
// Setting views directory
$view->start();
$view->render("nombres","index");
$view->finish();
// Printing views output
print_r($view->getContent());die();
}
Silly layout and action
<!DOCTYPE html>
<html>
<body>
<h1>My First Heading</h1>
<p>My first paragraph.</p>
<?php echo $this->getContent(); ?>
</body>
</html>
<p>This is my action from controller</p>
Do you know why? I saw information in stackoverflow but the same result :( Thx friends!