Nope! I guess we must not consider the superglobals in this case. And I'm pretty sure we both know, what the global "declaration" means.Holger wrote:I think there's a general misunderstanding on how "global" works or between what "global" is doing or not doing (= the superglobals in PHP)
Basically none! But that's not the point: consider the "A" plugin mentioned above. It includes jquery.inc.php in index.php, but it will definitly fail (at least on NTFS). If you can spare some additional time, please have a look at the "A" plugin. Make sure that it gets included before the jquery plugin, and you will see, what I'm talking about.Holger wrote: Where is the advantage to include jquery.inc.php inside another include and not in the plugins index.php?
Or you might consider the following example:
a.php:
Code: Select all
$var = 'a';
function a() {
include('b.php');
echo $var;
}
a();
Code: Select all
$var = 'b';
function b() {
global $var;
echo $var;
}
b();
+ 1Holger wrote:again, IMO it's better to make things not more complicated than they are
All I was asking for, is to extend the example in the jQuery4CMSimple documentation to
Code: Select all
global $pth, $plugin_cf; //be sure CMSimple variables are accessible in your function
Oh, and BTW: I really love jQuery4CMSimple, because it makes it so easy to use jQuery for CMSimple, and, of course, because jQuery/jQueryUI rocks
Christoph