I have a model (core_model.php) with lots of functions in there, however having an issue with the following one in specific :

 Class core_model {
    function __construct(){
        $this->EE =& get_instance();

        $settings = $this->_get_settings();


    function parse_user_template($data)
     $td = $this->EE->db->select("template_data")

     $parsed_data = $this->EE->TMPL->parse_variables_row($td,$data);

Basically, I'm calling the $this->EE->core_model->parse_user_template($data) function passing in a $data array of values which I want it to parse against the specific template file for me to do something with once parsed (namely to use it as an email body).

For some reason, I'm getting the following error:

Message: Undefined property: EE::$TMPL

Filename: models/core_model.php

Line Number: 69

Anyone have any ideas why this is the case and I can't parse it?

1 Answer 1


The loading of the template needs to be done as follows:


Now it works.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.