Cannot redeclare some_function() (previously declared.......
Posted: Fri Mar 23, 2007 11:47 am
Hi all,
Maybe I am missing the obvious, but I cant figure this out.
I am trying to develop my own module (I've started with the Skeleton module).
This is my action.test.php
if (!isset($gCms)) exit;
# The type of display is passed
$display = $params{'display'};
if ( $display == "full" ){
echo some_function($display);
}#if
if ( $display == "box" ){
echo some_function($display);
}#if
# Just a function to demonstrate
function some_function($test){
return $test;
}
?>
Now, in my content page I have
{cms_module module='MyModule' action='test' display='full'}
This works OK.
If i put the following in the template
{cms_module module='MyModule' action='test' display='box'}
I get the error
Cannot redeclare some_function() (previously declared in /cms/modules/MyModule/action.test.php:43)
Any ideas ?
thanks
Neil
Maybe I am missing the obvious, but I cant figure this out.
I am trying to develop my own module (I've started with the Skeleton module).
This is my action.test.php
if (!isset($gCms)) exit;
# The type of display is passed
$display = $params{'display'};
if ( $display == "full" ){
echo some_function($display);
}#if
if ( $display == "box" ){
echo some_function($display);
}#if
# Just a function to demonstrate
function some_function($test){
return $test;
}
?>
Now, in my content page I have
{cms_module module='MyModule' action='test' display='full'}
This works OK.
If i put the following in the template
{cms_module module='MyModule' action='test' display='box'}
I get the error
Cannot redeclare some_function() (previously declared in /cms/modules/MyModule/action.test.php:43)
Any ideas ?
thanks
Neil