Following on from this question, I'm now trying to rework the plugin so that I can do:
{exp:deetector}
{user_agent}
{hash}
{/exp:deetector}
but with the code below, I get no output:
public function __construct()
{
$this->EE =& get_instance();
include(PATH_THIRD.'/deetector/libraries/detector.php');
$this->ua = $ua;
$tagdata = $this->EE->TMPL->tagdata;
$variables[] = array(
'user_agent' => $this->ua->ua,
'hash' => $this->ua->uaHash,
'browser_os' => $this->ua->full,
'browser' => $this->ua->browser,
'browser_full' => $this->ua->browserFull
);
return $this->EE->TMPL->parse_variables($tagdata, $variables);
}
If I do $this->return_data = $this->ua->xx
for each of the variables listed above I get output, but not if I parse the $variables array.
I've also tried $variables = array
but get Undefined offset: 0.