本文整理汇总了PHP中AppConfig::read方法的典型用法代码示例。如果您正苦于以下问题:PHP AppConfig::read方法的具体用法?PHP AppConfig::read怎么用?PHP AppConfig::read使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppConfig
的用法示例。
在下文中一共展示了AppConfig::read方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct()
{
if (AppConfig::read('Smtp.enabled')) {
$config = array('transport' => 'Smtp', 'from' => array(AppConfig::read('Smtp.email') => AppConfig::read('Smtp.name')), 'host' => AppConfig::read('Smtp.host'), 'port' => AppConfig::read('Smtp.port'), 'timeout' => 30, 'username' => AppConfig::read('Smtp.login'), 'password' => AppConfig::read('Smtp.password'), 'client' => null, 'log' => false, 'charset' => 'utf-8', 'headerCharset' => 'utf-8');
} else {
$config = array('transport' => 'Mail', 'from' => array(AppConfig::read('Smtp.email') => AppConfig::read('Smtp.name')), 'charset' => 'utf-8', 'headerCharset' => 'utf-8');
}
$this->default = $config;
}
示例2: send_mail
public function send_mail()
{
if (!$this->request->is('ajax')) {
throw new NotFoundException();
}
if (!$this->request->is('post')) {
throw new NotFoundException();
}
$content = 'Imię i Nazwisko: <b>' . $this->request->data['Contact']['name'] . '</b><br>';
$content .= 'Firma: <b>' . $this->request->data['Contact']['company'] . '</b><br>';
$content .= 'Nr telefonu: <b>' . $this->request->data['Contact']['phone'] . '</b><br>';
$content .= 'E-mail: <b>' . $this->request->data['Contact']['email'] . '</b><br>';
$content .= 'Treść wiadomości:<br>----------------------------<br>' . nl2br($this->request->data['Contact']['message'] . '<br>----------------------------');
$Email = new CakeEmail();
$Email->template('default', 'default')->emailFormat('html')->from($this->request->data['Contact']['email'])->to(AppConfig::read('Site.email'))->subject('Zapytanie z formularza kontaktowego Termat.pl')->send($content);
if ($this->request->data['Contact']['copy'] == 1) {
$Email = new CakeEmail();
$Email->template('default', 'default')->emailFormat('html')->from($this->request->data['Contact']['email'])->to($this->request->data['Contact']['email'])->subject('Zapytanie z formularza kontaktowego Termat.pl [kopia]')->send($content);
}
die;
}
示例3: adminSendMail
public function adminSendMail($to, $subject, $content, $vars)
{
$content = file_get_contents(APP . 'View' . DS . 'Emails' . DS . 'html' . DS . 'contents' . DS . $content . '.ctp');
foreach ($vars as $key => $value) {
$content = str_replace('{{' . $key . '}}', $value, $content);
}
$Email = new CakeEmail();
$Email->template('admin', 'admin')->emailFormat('html')->from(array(AppConfig::read('App.email') => AppConfig::read('App.name')))->to($to)->subject($subject)->send($content);
}