I'm currently playing around with the xFCP Plugin (which by the side is already very nice, but I want to make it nicer =D) but I'm nagging on some limitations I couldn't find a solution for after trying for a couple of hours.
What I'm trying to do is not only related to this plugin, so I post this in the General Support forums:
The main question is in the topic title and here's an example for it (read the comments in the code pls):
$eventName = $modx->event->name;
switch($eventName) {
case 'OnLoadWebDocument':
$dir = $modx->getOption('base_path') . 'core/cache/fpc/' . $modx->resource->get('id') . '/';
// some other stuff
break;
case 'OnWebPageComplete':
// here I really need that $dir variable again, but I cannot generate or reference it (I think at least)
// because on this event I don't have a reference to $modx->resource
// so how can I pass this $dir variable to this event? Is this even possible?
break;
}
any idea, or am I just blind or plain stupid? =) (I admit that my php skills suck...so no problem with hearing it...anybody?)
EDIT: OK, I'm half stupid^^... just tried what I've written above (try'n'error) and tried to reference $modx->resource in the
OnWebPageComplete part of the plugin, and see, IT WORKED...but the docs
http://rtfm.modx.com/display/revolution20/OnWebPageComplete just say "None" under Event Parameters while it says "None. The resource can be referenced via $modx->resource." in the docs for
OnLoadWebDocument http://rtfm.modx.com/display/revolution20/OnLoadWebDocument ...
so just for clarification: Is $modx->resource everywhere available (in every system event) or is this just a bug in the documentation and should be fixed by somebody who knows on which events $modx->resource is available?
[ed. note: exside last edited this post 13 years, 10 months ago.]