Embedding your module output in a different page after a..

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Post Reply
Purevdorj
New Member
New Member
Posts: 3
Joined: Fri Dec 20, 2013 4:19 pm

Embedding your module output in a different page after a..

Post by Purevdorj »

Hello. I am reading the book CMS Made Simple Development Cookbook and tried one example from this book but it does not work. the $params['target'] is unknown. browser shows the error -

Warning: Parameter target is not known by module drinks dropped in C:\wamp\www\uptown\lib\misc.functions.php on line 1411

anyone can help me? I pasted the code of module here

Code: Select all

<?php
if (!isset($gCms)) exit;
$flavors = array('Sour'=>'sour', 'Bitter'=>'bitter',
'Sweet'=>'sweet', 'Salty'=>'salty', 'Umami'=>'umami');
if (isset($params['flavor']))
{
echo 'Yum ... '.array_search($params['flavor'],$flavors);
return;
}
$smarty->assign('form_start',
$this->CreateFormStart($id, 'default', $params['target']));
$smarty->assign('input_flavor',
$this->CreateInputRadioGroup($id, 'flavor', $flavors));
$smarty->assign('submit',
$this->CreateInputSubmit($id, 'submit', 'Submit'));
$smarty->assign('form_end', $this->CreateFormEnd());
echo $this->ProcessTemplate('form.tpl');
?>
chandra

Re: Embedding your module output in a different page after a

Post by chandra »

Which CMSMS version do you are using?
Jos
Support Guru
Support Guru
Posts: 4017
Joined: Wed Sep 05, 2007 8:03 pm
Location: The Netherlands

Re: Embedding your module output in a different page after a

Post by Jos »

You have to define the parameter in the file drinks.module.php like:

$this->SetParameterType('target',CLEAN_INT);

Check for example the News module: news.module.php where to put that line, and examples for other parameter types
Post Reply

Return to “Modules/Add-Ons”