Welcome Guest, Not a member yet? Register   Sign In
Clearing $_ci_cached_vars in Loader.php
#1

[eluser]tmountain[/eluser]
Hi,

I have a use case where I'm sending multiple emails to different recipients in a single script execution. The email templates are rendered in this fashion:

Code:
foreach ($recipients as $recipient) {
    // set $data as needed for each recipient
    $message = $this->load->view("emailTemplates/$template", $data, true);
    // send the message
}

I'm running into an issue with templates populating incorrectly because CI_Loader keeps old variables cached inside of $_ci_cached_vars. In some cases, this is causing recipients to receive data that isn't related to their email.

What's the best strategy for completely clearing any cached data between calls to $this->load->view()? It'd be preferable not to modify the CI source code (for obvious reasons).


Messages In This Thread
Clearing $_ci_cached_vars in Loader.php - by El Forum - 04-03-2013, 12:15 PM
Clearing $_ci_cached_vars in Loader.php - by El Forum - 04-03-2013, 12:32 PM
Clearing $_ci_cached_vars in Loader.php - by El Forum - 04-03-2013, 11:17 PM



Theme © iAndrew 2016 - Forum software by © MyBB