|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
kobe_brylle Smarty n00b
Joined: 07 Feb 2016 Posts: 2
|
Posted: Wed May 04, 2016 4:03 am Post subject: How to customize error handling? |
|
|
Hi guys I wanted to customize my error handling... here's the scenario
1. Define in php controller
Code: |
$this->CI->smarty->assign('_setData', $set_data);
|
2. $set_data contains
Code: |
Array
(
[facebook] => https://facebook.com/ <---- this will be removed i
[instagram] => https://instagram.com/
[twitter] => https://twitter.com/
)
|
4. code in html
Code: |
{$_setData.facebook}
|
5. I receive an error
Code: |
Severity: Notice
Message: Undefined index: facebook
Filename: templates_c/5125124f1e59f2258a491707dcd0a86cf434db62_0.file.home_template.html.php
Line Number: 94
Backtrace:.......
|
5.I am aware that there is no facebook in the array but I wanted to adjust the error that if the variable (ex. facebook) is not defined in the controller the smarty code (ex. {$_setData.facebook}) will just display null/empty/0.
How can I make this happen in smarty? Is this possible to adjust the smarty?
Let me know if you have question or clarifications to my post.
Thanks in advance! |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Wed May 04, 2016 6:12 pm Post subject: |
|
|
Smarty is not a programming language. I'm failing to see how is this question related to Smarty in any way. |
|
Back to top |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
|
Back to top |
|
|
|
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
|