Hi guys,
I have a question for you, is it possible to render volt syntax from a string and return the content?
here my case:
I'm implementing a widget system like this one https://forum.phalcon.io/discussion/330/widgets-with-volt-rendering
and is working fine in .volt files but I want to be able to render that syntax form a varible, basically I want to store the page content in the database like
<h1>Content</h1>
{{ render_widget('MyWidget', [$param1, $param2]) }}
store that string in the database and when the controller is called render the syntax and pass it to the view like this:
$page = new Page();
$content = $page->content;
//compile the content
$out = compiledContent;
$this->view->setVar("content", $out);
and the HTML will be
<h1>Content</h1>
<div>I'm MyWidget widget!</div>
is that possible?
While I'm talking about pages I have another question, is possible to call a function from the index controller without specify the index controller?
eg:
is calling the about controller, but I want to render the about page stored in the database, any thought?