Jump to content

Smarty Error?


lordphate

Recommended Posts

[code]/**
    * trigger Smarty error
    *
    * @param string $error_msg
    * @param integer $error_type
    */
    function trigger_error($error_msg, $error_type = E_USER_WARNING) <---- 1601
    {
        trigger_error("Smarty error: $error_msg", $error_type);
    }[/code]

Fatal error: Call to undefined function: trigger_error() in /home/arshemn/public_html/test/class/smarty/Smarty.class.php on line 1601


Link to comment
https://forums.phpfreaks.com/topic/15089-smarty-error/
Share on other sites

not sure what this is supposed to do...

but a couple things.

1)
function trigger_error($error_msg, $error_type = E_USER_WARNING)

I don't think you can give a value to $error_type here. I could be wrong, but you should be passing this var to the function, not defining it here.

2)
function trigger_error($error_msg, $error_type = E_USER_WARNING) <---- 1601
    {
        trigger_error("Smarty error: $error_msg", $error_type);
    }

it looks like you are calling the function from within its self.
I don't think you can do that.  what is the function supposed to do?  ???
Link to comment
https://forums.phpfreaks.com/topic/15089-smarty-error/#findComment-60771
Share on other sites

Micah,

That is valid, what it does is predefine the var, so that it is not required to be passed when the function is called.  i.e., he can call it as

[code]trigger_error("this is an error");[/code]
which will trigger a warning
or

[code]trigger_error("this is an error", E_NOTICE);[/code]
which will trigger a notice
Link to comment
https://forums.phpfreaks.com/topic/15089-smarty-error/#findComment-60784
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.