6

In cakephp 2.1 whats the difference between $this->data and $this->request->data?

Rowland Shaw
  • 37,700
  • 14
  • 97
  • 166
Ivan Santana
  • 101
  • 1
  • 7

1 Answers1

10

$this->data was used till cakephp 1.3

$this->request->data has replaced the $this->data array from cakephp 2.x onwards.

For backward compatibility $this->data is also still supported.

$this->request represents CakeRequest object and is accessible in Controller, Views and Helpers.

For more info : http://book.cakephp.org/2.0/en/controllers/request-response.html

evuez
  • 3,257
  • 4
  • 29
  • 44
jdecode
  • 171
  • 1
  • 6