I'm creating a plugin, that is return an array. This how my files structure
myplugin.php
class Plugin_myplugin extends Plugin
{
function foo()
{
return array(1,2,3,4,5);
}
}
In the default.html file, I can access it via {{ myplugin:foo }}
. Everything is working perfectly,
But I want to get second element of array. Or without using Lex Parser, How can I access via PHP?
You need to pass it as a parameter to plugin. For example:
Then in your plugin:
That's all.