Can any of the moodle developers explain to me why the requires->yui_module() function does not pass the YUI instance (Y) into the callback function?
i.e.
Y.use('xxx',function() {
// no access to 'Y' the YUI instance???
})
Thanks,
Well, don't use $PAGE->requires->yui_module.
Use $PAGE->requires->js_init_call.
See, for example
http://cvs.moodle.org/moodle/mod/quiz/attempt.php?view=markup
I know I have seen this function, but I was trying to follow the guidlines on:
http://docs.moodle.org/en/Development:How_to_create_a_YUI_3_module
It may seem like I'm nit picking, but I was partly curious as to why the Y arguement was omitted. I thought there might actually be a good reason?
Is there!
Interestingly, the first example on that page gets it right, then the others are wrong. I am too tired to work out how to fix it, so if you have got to the bottom of it, please update the wiki page.
Hopefully Sam Hemelryk, or Petr Skoda, who are the people that implemented most of this, will see this thread, and review any changes you make, or fix the page if you can't.