A user defined function cannot work in form view page.
I test it with the following test function, I put it in different files in my plugin's directory, it gives '15' on the files that locate in my plugin root, i.e. index.php, start.php, it gives '5' on other files..
function test($num){
global $num;
$num += 10;
}
$num =5;
test($num);
echo $num; // 5
It seems the global variable cannot be read. Do I miss something on initializing the plugin? Or Elgg has a framework limit?
info@elgg.org
Security issues should be reported to security@elgg.org!
©2014 the Elgg Foundation
Elgg is a registered trademark of Thematic Networks.
Cover image by RaĆ¼l Utrera is used under Creative Commons license.
Icons by Flaticon and FontAwesome.
- jdleung@jdleung
jdleung - 0 likes
- jdleung@jdleung
jdleung - 0 likes
You must log in to post replies.Can anyone help?
Thanks.
I had tested that the function could be called, so I think the problem is how to get the variable in the function. by now, I cann't get it even though it's set to global.