In the Section Simple Rendering in the Section "Using Views" of the Phalcon 2.0.0 Documentation is this Code Example:
<?php
use Phalcon\Mvc\Controller;
class PostsController extends \Controller
{
public function indexAction()
{
//Render 'views-dir/index.phtml'
echo $this->view->render('index');
//Render 'views-dir/posts/show.phtml'
echo $this->view->render('posts/show');
//Render 'views-dir/index.phtml' passing variables
echo $this->view->render('index', array('posts' => Posts::find()));
//Render 'views-dir/posts/show.phtml' passing variables
echo $this->view->render('posts/show', array('posts' => Posts::find()));
}
}
But thats wrong. I can't simply pass a string like in the first and second example.
This method Documentation looks like this:
/**
* Executes render process from dispatching data
* <code>
* //Shows recent posts view (app/views/posts/recent.phtml)
* $view->start()->render('posts', 'recent')->finish();
* </code>
*
* @param string $controllerName
* @param string $actionName
* @param array $params
* @return \Phalcon\Mvc\View
*/
public function render($controllerName, $actionName, $params = null) {}
So either the Method is wrong in Phalcon v2.0.0 or the Documentation is wrong and should be updated.
Which is wrong? The Documentation or is it a Bug in Phalcon v2.0.0?