Author Archives: Bob Ray

About Bob Ray

Bob Ray is the author of MODX: The Official Guide and over 30 MODX add-on components. He hosts Bob's Guides, a source of valuable information for MODX users, and has been very active in the MODX Forums with over 19,000 posts.

Fatal Error Cannot Redeclare Function I

Sooner or later, you’re likely to see an error like this one:           [code language=”html”] Fatal error: Cannot redeclare functionname() (previously declared in path/somefile.php:49) in path/somefile.php …

Tags: , , , , | Posted under Uncategorized | Leave a comment

Handling Included Files

In the previous articles, we put our functions insi de a class and included the class file with a line like this: [code language=”php”] include MODX_CORE_PATH . ‘components/mycomponentname/model/mymathfunctions.class.php’; $math = …

Tags: , , | Posted under MODX, MODX | Leave a comment

Fatal Error Cannot Redeclare Class

In the previous article, we used code like this to prevent collisions between function names: [code language=”php”] include MODX_CORE_PATH . ‘components/mycomponent/model/mymathfunctions.class.php’; $math = new MyMathFunctions(); echo $math->addIntegers(2,3); /* Displays 5 …

Tags: , , , | Posted under MODX, MODX | Leave a comment