When I use the CI framework to send emails, I need to introduce files and use the use function. Why does ci report an error? {Code ...} then an error will be reported, {code ...} how can I solve this problem? When I use the CI framework to send emails, I need to introduce files and use the use function. Why does ci report an error?
Public function login_action () {require 'vendor/autoload. php'; use Mailgun \ Mailgun ;}
Then an error is reported,
Parse error: syntax error, unexpected 'use' (T_USE) in .......
How can this problem be solved?
Reply content:
When I use the CI framework to send emails, I need to introduce files and use the use function. Why does ci report an error?
Public function login_action () {require 'vendor/autoload. php'; use Mailgun \ Mailgun ;}
Then an error is reported,
Parse error: syntax error, unexpected 'use' (T_USE) in .......
How can this problem be solved?
Use does not support the import of functions and constants. Generally, the import is outside the function.