3

I basically need to be able to pass through a $q that is a variable of a search form to a controller, which then calls an api and does a search with that $q..(it can be a an ID,ISBN or a title of the book).

http://pastebin.com/zMZxnJ81 this is my view

http://pastebin.com/JQ3HmFA9 this is my controller

I cannot pass the data from the view to the controller, I get the "last condition" message of the if statement.

0

2 Answers 2

3

Form method attribute can be set to "get" or "post". "request" which is the one you set, is not a valid value for method attribute.

You can have a look at your php.ini for $_REQUEST super global array settings like request_order setting.

Also it's a better way to use Zend request object functions such as

$this->_request->getParams()
$this->_request->getParam($key)
Sign up to request clarification or add additional context in comments.

1 Comment

Or, directly, in the controller, $this->_getAllParams() or $this->_getParam('q', 'some default value'), which work the same way as the above answer.
1

Have you tried with $this->getRequest()->getParam('q') instead of using $_REQUEST?

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.