-1

As on CakePHP 3.x, $this->view working properly in controller.

After migration to the CakePHP 4.x version, it doesn't seems to work. Can't find any documentation under CakeBook 4.x.

Is there any syntax changes in CakePHP 4.x for $this->view or it's deprecated in newer version ??

cursorrux
  • 1,382
  • 4
  • 9
  • 20
  • 2
    For the future, make sure that your code is properly covered by tests, and that you upgrade to the latest release of your currently used major first, solve all deprecation warnings, and then upgrade to the new major. – ndm Jan 29 '21 at 08:50

1 Answers1

1

Starting with CakePHP 3.1, the Controller $view property is deprecated.

https://book.cakephp.org/3/en/appendices/3-1-migration-guide.html#controller

view - replaced with template

In CakePHP 4.x use $this->viewBuilder() to setting and getting view options:

https://book.cakephp.org/4/en/controllers.html#setting-view-options https://book.cakephp.org/4/en/search.html?check_keywords=yes&area=default&q=viewBuilder

Salines
  • 5,674
  • 3
  • 25
  • 50