I am working with a plugin and wish to return a value from it to the template that calls it. In my plugin, there is an XML feed call, and I would like to pass a value(variable) from the plugin to the template that indicates whether there is any value for a particular XML query.
I currently am working with a Plugin Variable, which returns the XML output.
How would I be able to return a second value to the template for a conditional 'display/don't display' value? Would I need to set up a second class, apart from my main XML feed variable?
Thanks.
Here is the basic layout of the plugin:
XmlFeedVariable.php
<?php
namespace Craft;
class AiPaginationTestVariable
{
public function AiPaginationTestVariable($optional = null)
//the '$optional' in the function call passes to the xml call for the query
{
//performs XML call and string assembly here, then echo's to output
//if there is no xml returned, I would like to do this:
//$xml_return='no';
//then have the template pick it up.
}
}