Jump to content


Photo

Smarty Error?


  • Please log in to reply
2 replies to this topic

#1 lordphate

lordphate
  • Members
  • PipPipPip
  • Advanced Member
  • 154 posts

Posted 19 July 2006 - 11:29 PM

/**
     * 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);
    }

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




#2 micah1701

micah1701
  • Members
  • PipPipPip
  • Advanced Member
  • 613 posts
  • LocationEllington, CT USA

Posted 20 July 2006 - 02:27 AM

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?  ???
"Confidence in the face of risk."

#3 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 20 July 2006 - 02:49 AM

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

trigger_error("this is an error");
which will trigger a warning
or

trigger_error("this is an error", E_NOTICE);
which will trigger a notice




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users