Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我想$wgScriptPath在我正在构建的 mediawiki 扩展中使用该变量。每当我访问该变量时,我都会收到错误“未定义的变量:wgScriptPath”。 有谁知道在 mediawiki 扩展中访问这些类型变量的正确方法?
$wgScriptPath
提前致谢!
您是否将其声明为全局?
function foo() { echo $wgScriptPath; // this will echo the local variable in the // function's scope, which of course does not exist } function foo() { global $wgScripPath; echo $wgScriptPath; // this will echo the global variable }