function objectify($response) { if ($this->format == 'json') { $response = preg_replace('/^var [^\\{]*/', '', $response); $response = preg_replace('/;$/', '', $response); } return parent::objectify($response); }