All,
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...
==================================
case "add":
$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 "" //
if (file_exists($moderr))
{
$form = $mod;
include_once($moderr);
die;
}
==================================
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?
Thanks, all.
Steven J. Garcia
SLM Industries
General developer forum
Developing New Modules: Lesson Plan Module
This discussion has been locked so you can no longer reply to it.