#(index.php) while($row = $database->fetch_object($languages)) { $options->cache($options->template); /** * Works, echos out the correct items */ echo($row->shortname . '
'); echo($row->title . '
'); /** * Throws an error, Catchable fatal error: Object of class Template could not be converted to string in /home/sites/uvshock.co.uk/public_html/fenix/includes/class_template.php on line 42 */ $options->replace('shortname', $row->shortname); $options->replace('title', $row->title); } # (class_template.php lines 40-43) public function replace($needle, $replacement) { $this->cache = str_replace('{{' . strtoupper($needle) . '}}', $replacement, $this->cache); }