docs
docs copied to clipboard
v3 View::render() documentation incorrect/misleading
On this page: https://docs.phalconphp.com/3.4/en/views#simple-rendering, in the 3rd code block that demonstrates how to use render(), it references $this->view from a controller. By default that will be \Phalcon\Mvc\View - whose render() function accepts different arguments.
This is misleading as, when one reads this one assumes that $this->view->render() can accept a string argument, when in fact it can only accept controller & action arguments.
I recommend the code be updated from (for example)
echo $this->view->render('posts/show');
to
$SimpleView = new SimpleView();
echo $SimpleView->render('posts/show');
to be clearer that this code block is referring to the SimpleView functionality.