Category Archives: MODX

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

Fatal Error Cannot Redeclare Function II

In the previous article, we saw how to prevent an error like this one by wrapping the function in an if (! function_exists() statement. [code language=”html”] Fatal error: Cannot redeclare …

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