Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Error handing when using plugins

 
Post new topic   Reply to topic    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
TedK
Smarty n00b


Joined: 12 Sep 2019
Posts: 3

PostPosted: Tue Sep 24, 2019 11:44 am    Post subject: Error handing when using plugins Reply with quote

I created plugins so I can add data to the templates initiated from the templates. One of the plugins has an external and not always stable data source. Now I want to trigger an error in the template when the data source is not available. In V2 there was $smarty->trigger_error. What is the replacement of this in V3? Or what is the best way to return an error to the template?
Back to top
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1572

PostPosted: Wed Oct 02, 2019 8:55 pm    Post subject: Reply with quote

Depends, how severe you consider the problem, you can handle it in the plugin or just throw an exception.
There's no reason anything like that should exists in the templating engine.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP