PHP FrameWorks (MVC) and 'use' operator
donovandb opened this issue · 2 comments
Hello, The sample code has stuff like:
require 'vendor/autoload.php'; require_once 'constants/SampleCodeConstants.php'; use net\authorize\api\contract\v1 as AnetAPI; use net\authorize\api\controller as AnetController;
When working in CodeIgniter (for example), or any framework that uses Model View Controller, the use of the 'use' operator is not permitted inside functions.. which is how one usually creates payment gateways in these FrameWorks (Function inside of a controller include.. or in my case, a "helper" function).
What is the recommended sample code for using the API in these frameworks?.. or rather, specifically... inside functions?
Just a followup. I have managed this. Please see here for a codeigniter guide:
https://forum.codeigniter.com/thread-72281.html
Thank you for sharing your implementation this with us, @donovandb !
Closing this issue. Feel free to reopen in case of updates or queries.