Re: no template syntax errors shown with debugging_ctrl?
| From: | Lance E Sloan | Date: | Mon, 02 Aug 2004 18:11:34 +0000 |
| Subject: | Re: no template syntax errors shown with debugging_ctrl? | ||
| References: | 1 2 3 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-11655@lists.php.net to get a copy of this message | ||
--On Friday, July 30, 2004 12:56 PM -0400 Lance E Sloan <lsloan@umich.edu> wrote:
It would be *nice* if the Smarty display method would return some value indicating success or failure, and what kind of failure. Hmm... I think that maybe I should try the fetch method instead. I could do a fetch, if there's no output, turn on debugging and fetch again.Checking the results of the fetch() method didn't help. Of course, that makes sense, as display() is just a wrapper around fetch() with $display set to true. The parser, and my whole program, just dies when it finds a simple syntax error in a template. To confuse matters, the code that uses Smarty was written by another programmer who set up a few parameters for error reporting, but they are apparently ineffective in this case. On the other hand, they subclassed Smarty, so I will be able to work some error checking into our own version of display(). I've settled for using set_error_handler() before I call display(). I specify an error handler that prints errors similarly to the default handler. (I make the error messages a little different, though.) I will probably change the handler to return the errors rather than print them, so that the code that calls our subclassed display() can decide what to do about it. -- Lance E Sloan, Systems Research Programmer III U-M WATS: Web Applications, Technologies, and Solutions Full-service web and database design, development, and hosting. http://www.itcs.umich.edu/wats/ - "Putting U on the Web"