[Solved] Frontend coding

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
musicscore
Power Poster
Power Poster
Posts: 477
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

[Solved] Frontend coding

Post 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
Last edited by musicscore on Sun Feb 19, 2012 2:06 pm, edited 1 time in total.
Jos
Support Guru
Support Guru
Posts: 4019
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Frintend coding

Post 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'));
musicscore
Power Poster
Power Poster
Posts: 477
Joined: Wed Jan 25, 2006 11:53 am
Location: Netherlands

Re: Frintend coding

Post by musicscore »

Jos,

This did it. I did forget

Code: Select all

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

Return to “Developers Discussion”