Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-30-2008, 03:32 AM
Junior Member
 
Join Date: Apr 2008
Posts: 1
Exclamation How to read parameters from URL in ZF?

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-30-2008, 02:21 PM
Elemental's Avatar
Senior Member
 
Join Date: Jul 2007
Posts: 119
Default

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
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:21 AM.