1999 Posts in 530 Topics by 433 members
E-Commerce Modules
SilverStripe Forums » E-Commerce Modules » getting URL parameters
Discuss about the various e-commerce modules available:
Ecommerce, SS Shop, SilverCart and SwipeStripe
Alternatively, have a look the shared mailinglist.
Moderators: martimiz, Nicolaas, Howard, Sean, Ryan M., biapar, Willr, Ingo, Jedateach, swaiba, simon_w
|
Page:
1
|
Go to End | |
| Author | Topic: | 433 Views |
-
getting URL parameters

3 January 2013 at 9:06pm Last edited: 3 January 2013 9:31pm
I've got the eWay payment gateway returing to my site on the URL http://silverstripe/ewayctl/success/00073?debug_request=1
I'm trying to get the $ID value of 00073 so I can edit that record on the Database, but it looks like the values are NULL by the time it gets to my controller
Debug (line 155 of RequestHandler.php): Testing '$Action//$ID/$OtherID' with '' on eWay_Controller
Debug (line 163 of RequestHandler.php): Rule '$Action//$ID/$OtherID' matched to action 'handleAction' on eWay_Controller. Latest request params: array ( 'Action' => NULL, 'ID' => NULL, 'OtherID' => NULL, )I'm trying to do this in the class eWay_Controller extends Controller - (I'm guessing the $this is wrong)
if($id = $this->param('ID')){
$p = DataObject::get_one('eWay',"\"ID\" = '$id'");
$this->payment = $p;
return $p;
}this is on SS 3.0.3
this is my routes.yml
---
Name: paymentroutes
After: framework/routes#coreroutes
---
Director:
rules:
'ewayctl/$Action/$ID/$OtherID' : 'eWay_Controller'Update
I can do it using
Director::urlParam('ID')
in the controller but I get a deprecation notice:Director::urlParam is deprecated. Use SS_HTTPRequest->param() instead.
I'm not sure what the SS_HTTPRequest object/variable name is from within the Controller to call it properly
thanks
-
Re: getting URL parameters

4 January 2013 at 7:34pm
this is what i needed
http://www.silverstripe.org/general-questions/show/18118
just gotta ask Google the right question to find the right answer "Director::urlParam is deprecated"
| 433 Views | ||
|
Page:
1
|
Go to Top |

