|
|||
|
Hi, some one please help me with this.
I build a web system with ZF, when user sign up, will need to activate via email that the system send out with parameter in the url such as "http://zxc.com/userId/34kjklnkj4k3jn" , userId is the parameter and "34kjklnkj4k3jn" is the value. How I can read the parameter from the page? Consider my page have no class or function which $this->_request->getParam('userId); is not working. Thank you ![]() |
|
||||
|
Unless you setup a custom route http://zxc.com/userId/34kjklnkj4k3jn will route to the user-idController.
You need to include the controller and action in your url, http://zxc.com/auth/register/userId/34kjklnkj4k3jn or something similar. Then userId will be in the params array and getParam will find it.
__________________
Zend Framework Resources: Zend Webinars | Reference Manual | API Docs | Books | FreeNode: #zftalk Getting Started Tutorials: Getting started with ZF | Getting started with Zend Auth |
|
|||
|
Code:
$this->_request->getParam('PARAM NAME HERE')
Code:
http://localhost/<controller>/<action>/param/value/param2/value2/etc... I don't see why there's a param in the index.phtml. Or why there should be one. But you can always concider linking to Code:
http://localhost/<controller>/index Code:
http://localhost/<controller> |
|
|||
|
Yes I want to know How I can get directly all the parameters. If I have url://mywebsite/<controller>/action/param1/value1/param2/value2/
Is it possible to get directly param1 and param2 values in one array (for example) ? Thank you. |
|
|||
|
url = http://jaxiom/gratitudefrog/editreci.../recipes/id/50
Code is : <pre> <?php print_r($this->_request->getParams()); ?> </pre> Response is: Fatal error: Call to a member function getParams() on a non-object in /var/www/html/jaxiom/application/views/scripts/gratitudefrog/editrecipe.phtml on line 2 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|