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
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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.