Page 1 of 1

[Solved] Frontend coding

Posted: Sat Feb 18, 2012 6:05 pm
by musicscore
I'm building my first module and I managed, with the help of this forum, to develop the complete backend, administrative, part.
Now I want to build the frontend but ....

I created a link in action.default.php

Code: Select all

    	$onerow->name = $this->CreateLink($id, 'domaindetail', $returnid, $row['name'], array('domain_id'=>$row['domain_id']));
When I open the page and put my cursor on the link it shows :

Code: Select all

http://{mydomain}/index.php?mact=MFM,cntnt01,domaindetail,0&cntnt01domain_id=1&cntnt01returnid=57
As you can see, the domain_id is in the link but when I try to get the domain_it in the following code using $params there seems to be no $params('domain_id'). Print_r($params) shows 'Array ( [returnid] => 57 [action] => domaindetail'. There is no domain_id.

It works in backend. why not in frontend ?

Please help

Re: Frintend coding

Posted: Sun Feb 19, 2012 11:32 am
by Jos
Do you have these lines in your MFM.module.php file?

Code: Select all

$this->RestrictUnknownParams();
$this->SetParameterType('domain_id',CLEAN_INT);
and optionally

Code: Select all

$this->CreateParameter('domain_id', 0, $this->Lang('help_domain_id'));

Re: Frintend coding

Posted: Sun Feb 19, 2012 2:05 pm
by musicscore
Jos,

This did it. I did forget

Code: Select all

$this->SetParameterType('domain_id',CLEAN_INT);
::)
Thanx for your help.