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


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-24-2008, 04:43 AM
Junior Member
 
Join Date: Feb 2008
Posts: 1
Default Pass params through Links

Hey everyone,
Im kinda new here so ill do this the best i can.
Thing is im trying to send some params through a link i.e.
i wanna do something like this :
Code:
<a href='mycontroller/validation.php?param=1'>this is the link</a>
but i need to do this in order to use ZF MVC

Code:
<a href='mycontroller/doValidation'>this is the link</a>
This will make a call to the backend app and it will call a view process data and set a template to finally render the results in a "*.tpl.php" file.

The question is fairly simple, How can i pass variables like in the first example
i mean should i do something like this?

Code:
<a href='mycontroller/doValidation?param=1'>this is the link</a>
I know i shouldn't so thats the question, i gess its quite simple but im new on ZF and if someone can help me it would be more than appreciate it!

Best regards.


Jmc.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-25-2008, 06:05 AM
Junior Member
 
Join Date: Aug 2007
Posts: 4
Default

hi

for your example you can do the following.

<a href='mycontroller/doValidation?param=1'>this is the link</a>

to

<a href='mycontroller/doValidation/param/1'>this is the link</a>

or

example.com/controller/action/param1/value1/param2/value2 etc... go on and on...

the value can then be retrieved with $this->_getParam('param1'); in the action function.
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 11:51 AM.