where to put and how to call function |
Hello Everyone!
I'm new to CodeIgniter (MVC) framework. I just want to ask where do I put my function so that can use it in every View. like for example I have function that convert number in to another number, an i need to use it n another view. the function is long and I don't want to copy it in every view thanks
Create a helper function:
https://codeigniter.com/user_guide/gener...ng-helpers and load it before using it: https://codeigniter.com/user_guide/gener...ng-helpers If you use it in every request, you can autoload the helper: https://codeigniter.com/user_guide/gener...ng-helpers
The placement and invocation of a function depend on the programming language and the specific context of your code. Typically, functions are defined at the beginning or within the scope where they will be used and called wherever their functionality is needed.GB whatsapp apk
|
Welcome Guest, Not a member yet? Register Sign In |