views:

256

answers:

2

How I can call my callback in a helper?

If i create the callback in the controller works fine, but if I create it in a helper, CI does not call it automatically.

A: 

If you want something to be available universally, you can put that in file:

system/codeigniter/Common.php

hope that helps :)

Sarfraz
A: 

RE:

If you want something to be available universally, you can put that in file:

system/codeigniter/Common.php

Thats VERY bad practice. You should never touch any files in the system-directory. If you wanna change core-behavior, you should extend things or create new helpers or libraries in the application-folder.

Johan André
@Johan André - welcome to Stack Overflow. Generally, this sort of thing should be a comment (but I know you don't have the rep to do that yet). Because answer orders change, it may not be clear in future what your answer refers to.
McDowell