Cannot redeclare some_function() (previously declared.......

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
neiljb

Cannot redeclare some_function() (previously declared.......

Post by neiljb »

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
Locked

Return to “Modules/Add-Ons”