$this->viewPath is not working with CakePHP 3.1 -


i have updated cakephp application 3.1 through composer, , i'm trying fix small or deprecated warnings.

i fix $this->layout stuff don't understand how fix viewpath errors.

looking @ migration guide looks should same thing:

$this->viewpath = 'element'; 

should become

$this->viewbuilder()->viewpath('element'); 

but not working, , thing is

error: call undefined method cake\view\viewbuilder::viewpath()  file /var/www/myapp/src/controller/invoicescontroller.php  line: 375 

what correct way fix this?

from same migration guide, in view section of it:

view::$viewpath deprecated. should use view::templatepath() instead.

guess it's now:

$this->viewbuilder()->templatepath('element'); 

Comments

Popular posts from this blog

java - Date formats difference between yyyy-MM-dd'T'HH:mm:ss and yyyy-MM-dd'T'HH:mm:ssXXX -

c# - Get rid of xmlns attribute when adding node to existing xml -