I am writing my first EE plugin and have finally hit a roadblock. Here is how it looks
class Thank_you {
public function __construct()
{
$this->EE = get_instance();
$entries = $this->EE->db->from('channel_titles')->get();
}
public function contacts()
{
$db2 = $this->EE->load->database('ext_db', TRUE);
$query = $db2->select('FirstName, LastName, MealType')->order_by('id','DESC')->get('contact',10);
$contacts = $query->result();
return $this->EE->TMPL->parse_variables($this->EE->TMPL->tagdata, $contacts);
}
So the goal here is to pass an array of contacts to the template and iterate from there. All that I get with
{exp:thank_you:contacts}
{FirstName}
{/exp:thank_you:contacts}
Is an output of {FirstName}. Where am I going wrong on this.
Thanks!