0

Hello every one i am new to zend framework. Is it possible to get the value of passed variable in the url in our form. For example: example.com/sth/edit/id/5 Is it possible to use get variable id in our form.

Could you please provide solution for this issue.

1 Answer 1

3

This should work:

// get param from request
$param = $this->getRequest()->getParam('test');

// create form
$form = new My_Form_Test();

// set value from param to testElement
$form->getElement('testElement')->setValue($param);
Sign up to request clarification or add additional context in comments.

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.