[SOLVED] How to get the parameters of a module ?

Talk about writing modules and plugins for CMS Made Simple, or about specific core functionality. This board is for PHP programmers that are contributing to CMSMS not for site developers
Post Reply
vinc
Forum Members
Forum Members
Posts: 26
Joined: Thu Jun 14, 2007 10:01 am

[SOLVED] How to get the parameters of a module ?

Post by vinc »

Hi folks,

I'm trying to make a new payment gateway module.
I've based the module from the PaypalGateway one (by Ted and Calguy) but the behaviour is not exactly the same :
Paypal : create a form and post to paypal website
Citelis : create a form and post to a local php file

The local php have to get some parameters from the module (initially an include of a file).

I've set up these params in the admin section of the module and therefore i can access to them from CitelisGateway.module.php by a $this->GetPreference(...)

-> I can't pass the parameters as POST data (bank_id and password)

How can I do this the 'correct' cmsms way ?

Do i have to register a route to the post.php (action.post.php) to make this possible ?

Code: Select all

 $this->RegisterRoute('/[Cc]itelis\/post\/(?P<returnid>[0-9]+)$/', array('action'=>'post')) 
Any help or suggestion appreciated :)
Last edited by vinc on Fri Feb 24, 2012 8:17 pm, edited 1 time in total.
vinc
Forum Members
Forum Members
Posts: 26
Joined: Thu Jun 14, 2007 10:01 am

Re: How to get the parameters of a module ?

Post by vinc »

Registering the route is fine :
As the page receiving the post data is an action of the module, you can access all the vars directly by $this->GetPreference(...)

Auto-Solved :)
Post Reply

Return to “Developers Discussion”