If you just use the constructor for the output, make sure that the plugin class has a public property return_data that contains parsed tags:
$this->return_data = $this->EE->TMPL->parse_variables($tagdata, $variables);
For any other method in the class, you can simply return the processed data according to your example.
As a side element, I suppose you are not looping any data here. Use the parse_variables_row method parse_variables_row , so additional variables, such as count , total_results and switch , are omitted. Using this method does not require a nested array, so it boils down to the following:
$variables = array( 'user_agent' => $this->ua->ua, ... ); $this->return_data = $this->EE->TMPL->parse_variables_row($tagdata, $variables);
source share