CodeIgniter Forums
Accesto from view to function of two distinct controller - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Development (https://forum.codeigniter.com/forumdisplay.php?fid=6)
+--- Forum: CodeIgniter 3.x (https://forum.codeigniter.com/forumdisplay.php?fid=17)
+--- Thread: Accesto from view to function of two distinct controller (/showthread.php?tid=76828)



Accesto from view to function of two distinct controller - apanyz - 06-24-2020

Hello !! This is my first post and I have searched about this but there are no results ...


I have a view called from one controller, but if possible I need to execute a function from another controller.

Can this be done?
How ?


Thank you and sorry for my English


RE: Accesto from view to function of two distinct controller - jreklund - 06-24-2020

You are only able to share the same function in a Controller, if they both extend the same parent.

Movies extends Example
Games extends Example

Movies and Games can now access functions in Example.

Or you need to add your functionally to a library, so you can share functions that way.


RE: Accesto from view to function of two distinct controller - apanyz - 06-26-2020

Thank you !

I think my question has been resolved.