tupo-zski
tupo-zski

Reputation: 11

CakePHP get form query, Error: An Internal Error Has Occurred

I use get form for searching keywords. (CakePHP 2.2.5)

I see weird problems. Firstly from CakePHP documentation : $foo = $this->request->query('value_that_does_not_exist'); give

Error: An Internal Error Has Occurred.

Method query does not exist

I tried that in both Controller and the view. According to the manual it can be used to:

...read the url query array in an error free manner.

Btw,

$foo = $this->request->query['value_that_exist'];

works fine but I have to check it with “isset()“

Is it a CakePHP bug? I tested with fresh 2.2.5 install.

Upvotes: 1

Views: 2070

Answers (1)

dhofstet
dhofstet

Reputation: 9964

No, it is not a bug. The query() method was introduced in CakePHP 2.3.0-beta (see http://bakery.cakephp.org/articles/lorenzo/2012/10/28/cakephp_2_3_0-beta_released#cakerequest) and hence it is not available in CakePHP 2.2.5.

Upvotes: 1

Related Questions