_subtemplates[] = $template; // We can also add it to the beginning of the list, though. else array_unshift($this->_subtemplates, $template); } public function clear() { $this->_subtemplates = []; } public function pass($id, $data) { $this->{$id} = $data; } }