How does helpers, libraries and ThirdParty work? - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: CodeIgniter 4 (https://forum.codeigniter.com/forumdisplay.php?fid=28) +--- Forum: CodeIgniter 4 Support (https://forum.codeigniter.com/forumdisplay.php?fid=30) +--- Thread: How does helpers, libraries and ThirdParty work? (/showthread.php?tid=75697) |
How does helpers, libraries and ThirdParty work? - jackylim - 03-07-2020 Hi. I need some help here. I can't understand how to use helpers, libraries and thirdParty. If anymore can create the sample of source code and share with me? So that I can look at it. Also, how to auto load helpers, libraries and thirdparty if that is possible. Cause I had go thru the document. But I can't understand it. RE: How does helpers, libraries and ThirdParty work? - MatheusCastro - 03-07-2020 Hello!
I will answer your question in parts.
Helpers can be used this way:
PHP Code: helper($filename) Documentation link When a new helper is created, the file name must be convert_helper.php for example and is loaded in the same way as above, in this case helper ('convert') A library is used as follows: PHP Code: <?php To load automatically, use the Base Controller and extend it in your controller classes PHP Code: <?php and your controller extends BaseController RE: How does helpers, libraries and ThirdParty work? - jackylim - 03-07-2020 (03-07-2020, 04:55 AM)MatheusCastro Wrote:Thanks Matheus Castro. Your explanation is very good. I will try on it. Do you know about using Third Party? RE: How does helpers, libraries and ThirdParty work? - captain-sensible - 03-09-2020 (03-07-2020, 03:59 AM)jackylim Wrote: Hi.By "third party" you mean use one or more of your own php classes ? |