<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>trigger_error()</title> <meta name="generator" content="DocBook XSL Stylesheets V1.75.1"> <link rel="home" href="index.html" title="Smarty Manual"> <link rel="up" href="api.functions.html" title="Chapter 13. Smarty Class Methods()"> <link rel="prev" href="api.register.resource.html" title="register_resource()"> <link rel="next" href="api.template.exists.html" title="template_exists()"> </head> <body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> <div class="navheader"> <table width="100%" summary="Navigation header"> <tr><th colspan="3" align="center">trigger_error()</th></tr> <tr> <td width="20%" align="left"> <a accesskey="p" href="api.register.resource.html">Prev</a> </td> <th width="60%" align="center">Chapter 13. Smarty Class Methods()</th> <td width="20%" align="right"> <a accesskey="n" href="api.template.exists.html">Next</a> </td> </tr> </table> <hr> </div> <div class="refentry" title="trigger_error()"> <a name="api.trigger.error"></a><div class="titlepage"></div> <div class="refnamediv"> <h2>Name</h2> <p>trigger_error() — output an error message</p> </div> <div class="refsect1" title="Description"> <a name="id3106811"></a><h2>Description</h2> <code class="methodsynopsis"><span class="type">void </span><span class="methodname">trigger_error</span>(<span class="methodparam"><span class="type">string </span><span class="parameter">error_msg</span></span>,<br> <span class="methodparam"><span class="type">int </span><span class="parameter">level</span></span>);</code><p> This function can be used to output an error message using Smarty. <em class="parameter"><code>level</code></em> parameter can be one of the values used for the PHP <a class="ulink" href="http://php.net/trigger_error" target="_top"> <code class="varname">trigger_error()</code></a> function, eg: <code class="literal">E_USER_NOTICE</code>, <code class="literal">E_USER_WARNING</code>, etc. By default it's <code class="literal">E_USER_WARNING</code>. </p> <p> See also <a class="link" href="variable.error.reporting.html" title="$error_reporting"> <em class="parameter"><code>$error_reporting</code></em></a>, <a class="link" href="chapter.debugging.console.html" title="Chapter 10. Debugging Console">debugging</a> and <a class="link" href="troubleshooting.html#smarty.php.errors" title="Smarty/PHP errors">troubleshooting</a>. </p> </div> </div> <div class="navfooter"> <hr> <table width="100%" summary="Navigation footer"> <tr> <td width="40%" align="left"> <a accesskey="p" href="api.register.resource.html">Prev</a> </td> <td width="20%" align="center"><a accesskey="u" href="api.functions.html">Up</a></td> <td width="40%" align="right"> <a accesskey="n" href="api.template.exists.html">Next</a> </td> </tr> <tr> <td width="40%" align="left" valign="top">register_resource() </td> <td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td> <td width="40%" align="right" valign="top"> template_exists()</td> </tr> </table> </div> </body> </html>