Welcome Guest, Not a member yet? Register   Sign In
CodeIgniter helper functions
#2

It's to avoid fatal errors due to redeclaration of functions. If you have a function called 'foo' declared somewhere else, when trying to redeclare it, the script will produce a fatal error. By implementing this check, if the function is already declared, the script will continue, but you won't see the new function at work, since it will not be declared.
I would also add:

```
} else {
log_message('error', 'The \'foo\' function was declared previously');
}
```
Reply


Messages In This Thread
CodeIgniter helper functions - by Dilemma - 11-10-2024, 11:30 PM
RE: CodeIgniter helper functions - by allone - 11-17-2024, 12:26 AM



Theme © iAndrew 2016 - Forum software by © MyBB