本文整理汇总了PHP中site::option方法的典型用法代码示例。如果您正苦于以下问题:PHP site::option方法的具体用法?PHP site::option怎么用?PHP site::option使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类site
的用法示例。
在下文中一共展示了site::option方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: action_contact
public function action_contact()
{
$errors = false;
if ($_POST) {
$val = Validation::factory($_POST);
$val->rule('sprot', 'exact_length', array(':value', 1));
$val->rule('email', 'not_empty');
$val->rule('email', 'email');
$val->rule('suggestion', 'not_empty');
if ($val->check()) {
notes::success('Your message has been sent and we will get back to you as soon as possible. Thanks!');
$mail = mail::create('suggestion')->to('morningpagesnet@gmail.com')->from(arr::get($_POST, 'email', ''))->content(arr::get($_POST, 'suggestion') . '<br /><br />.E-mail: ' . arr::get($_POST, 'email', ''))->subject('Message to ' . site::option('sitename'))->send();
site::redirect('contact');
} else {
$errors = $val->errors('suggestions');
}
}
$this->bind('errors', $errors);
seo::instance()->title("Contact Morning Pages");
seo::instance()->description("Feel free to contact MorningPages.net if you have questions or concerns about your account, the site or for more information regarding your Morning Pages.");
}
示例2: send
$this->from = $email;
return $this;
}
public function send()
{
$this->save();
$from = site::option('emailfrom');
if ($this->from) {
$from = $this->from;
}
$headers = "Content-type: text/html; charset=UTF-8\r\nFrom:" . site::option('sitename') . " <" . $from . ">";
$message = View::factory('templates/mail');
$message->mail = $this;
try {
if (mail($this->to, $this->subject, $message, $headers)) {
$this->sent = time();
$this->save();
return true;
}
} catch (exception $e) {
Log::instance()->exception('Couldnt send mail! ID: ' . $this->id, $e);