我正在使用 CodeIgniter,我想自动加载电子邮件配置文件并在我的控制器、库中使用。
我将电子邮件配置添加到config/autoload.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
...some code ...
*/
$autoload['libraries'] = array(
'database',
'session',
'locale',
'util/ScriptLoader',
'activity/Message',
'Auth_lib',
'email'
);
我的配置/email.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
/*
...some code ...
*/
$config['useragent'] = "CodeIgniter";
$config['mailpath'] = "/usr/bin/sendmail"; // or "/usr/sbin/sendmail"
$config['protocol'] = "mail";
$config['smtp_host'] = "localhost";
$config['smtp_user'] = "";
$config['smtp_pass'] = "";
$config['smtp_port'] = "25";
$config['system_email'] = "noreply@xxxx.com";
$config['help_email'] = "help@xxxxx.com";
$config['inquiries_email'] = "inquiries@xxxx.com";
$config['support_email'] = "support@xxxx.com";
我试图support_email
在我的控制器中使用
$this->config->item('support_email')
但不起作用,如何在控制器中获取自动加载的值?请帮忙