本文整理汇总了PHP中sfRequest::getHost方法的典型用法代码示例。如果您正苦于以下问题:PHP sfRequest::getHost方法的具体用法?PHP sfRequest::getHost怎么用?PHP sfRequest::getHost使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfRequest
的用法示例。
在下文中一共展示了sfRequest::getHost方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeReactivate
public function executeReactivate(sfRequest $request)
{
$user = sfGuardUser::getUserByUsername($request->getParameter('username'));
if (!$user || $user->getIsActive()) {
return;
}
try {
// Create the mailer and message objects
$mailer = $this->getMailer();
// Render message parts
$profile = $user->getProfile();
$profile->setValidate('n' . self::createGuid());
$profile->save();
$mailContext = array('name' => $profile->getFullname(), 'validate' => $profile->getValidate());
$message = Swift_Message::newInstance();
$from = sfConfig::get('app_sfApplyPlugin_from');
$message->setFrom($from['email'], $from['fullname']);
$message->setTo($profile->getEmail(), $profile->getUser()->getUsername());
$message->setSubject(sfConfig::get('app_sfApplyPlugin_apply_subject', "Активация аккаунта на сайте " . $request->getHost()));
$message->setBody($this->getPartial('sfApply/sendValidateNew', $mailContext), 'text/html');
$message->addPart($this->getPartial('sfApply/sendValidateNewText', $mailContext), 'text/plain');
$mailer->send($message);
return 'After';
} catch (Exception $e) {
$mailer->disconnect();
$profile = $this->form->getObject();
$user = $profile->getUser();
$user->delete();
// You could re-throw $e here if you want to
// make it available for debugging purposes
return 'MailerError';
}
}