docs icon indicating copy to clipboard operation
docs copied to clipboard

Error in Views documentation

Open diplopito opened this issue 3 years ago • 0 comments

With Phalcon\Mvc\View

echo will produce this error:

Object of class Phalcon\Mvc\View could not be converted to string

Only php use Phalcon\Mvc\View\Simple can be used combined with echo.

The following examples also produce an error:

// 'views-dir/index.phtml'
 echo $this->view->render('index');  //returns error: Wrong number of parameters

 // 'views-dir/posts/show.phtml'
 echo $this->view->render('posts/show'); //returns error: Wrong number of parameters. 

//Apparently only works with the format:
$this->view->render("posts", "show")

[...] Haven't checked the ones with the models

// Phalcon\Mvc\View
$view = new View();
echo $view->render('invoices', 'view', $params); //This one works but without `echo`

I've tested with PHP 7.4, Phalcon 4.1, both in Windows 10 and Ubuntu 20.04.

If the errors are validated by dev team, I can make the changes in the docs.

diplopito avatar Apr 17 '21 21:04 diplopito