EE 1.70
I’ve got a bit of custom PHP scripting in a template, and there’s a certain condition that - if it occurs - I want to know about it. In pseudo-script:
if ($x == $bad_value)
{
write_to_error_log("Warning! Variable X had a bad value!");
}What’s the easiest way to do this, and is there a way to have it show up along with usual EE template errors (since it really would be a template error, despite being PHP)?
[Mod Edit: Moved to the Development and Programming forum]
I have the same issue but I am trying to log from an extension I am writing for the SAFE Cracker hook “safecracker_submit_entry_end”. I use the log_item method but it throws the php error as described above.
$this->EE->TMPL->log_item("debug:email = ".$msg);I tried to load the template library but get the same error. Any suggestions?
EE 2.1.1
Looks like that is working. I should have figured this out. Clearly the model does not have the log_item function. It is the library that has it. Also answers my question where those symbols are coming from like TMPL and DB, etc. Are they only local to the function / class that creates them our are they global in scope? Thanks!
Thanks for your help!
Packet Tide owns and develops ExpressionEngine. © Packet Tide, All Rights Reserved.