I've been working on developing a Lesson Plan module for Moodle as part of a project. Recently, I ran into problems where I recieved a "Cannot create new instance of <module name> ..." and I'm redirected to a view.php ID. After going in and doing some echo() debugging, I came up with the following variable definitions that my mod.html/php is passing to mod.php....
First, the code snippet that I changed for debugging purposes...
$return = $addinstancefunction($mod);
if (!$addinstancefunction($mod)) // shouldn't matter
echo "Vars"; // I used this as a marker flag //
echo $mod; // prints out "Object" thanks to the forced type... //
echo "$addinstancefunction($mod)"; // same as $return; returns "plans_add_instance(Object)" //
echo "$_POST"; // returns "Array" //
echo"$Array"; // returns nothing? //
echo "\"" . $return . "\""; // returns "" //
$form = $mod;
Has anyone else developed a module that communicates through mod.php that might be able to offer any pointers? Anyone have a clear roadmap for the mod.php case-switch in the sky? Anyone have some examples they can let me see?
Steven J. Garcia