本文整理汇总了PHP中sfWebRequest::getMailMessage方法的典型用法代码示例。如果您正苦于以下问题:PHP sfWebRequest::getMailMessage方法的具体用法?PHP sfWebRequest::getMailMessage怎么用?PHP sfWebRequest::getMailMessage使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类sfWebRequest
的用法示例。
在下文中一共展示了sfWebRequest::getMailMessage方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeImage
public function executeImage(sfWebRequest $request)
{
$member = $this->getRoute()->getMember();
if (!$member) {
return sfView::NONE;
}
$message = $request->getMailMessage();
$images = $message->getImages();
foreach ($images as $image) {
$count = $member->getMemberImage()->count();
if ($count >= 3) {
return sfView::ERROR;
}
$validator = new opValidatorImageFile();
$validFile = $validator->clean($image);
$file = new File();
$file->setFromValidatedFile($validFile);
$file->setName('m_' . $member->getId() . '_' . $file->getName());
$memberImage = new MemberImage();
$memberImage->setMember($member);
$memberImage->setFile($file);
if (!$count) {
$memberImage->setIsPrimary(true);
}
$memberImage->save();
}
return sfView::NONE;
}
示例2: executeImage
public function executeImage(sfWebRequest $request)
{
$member = $this->getRoute()->getMember();
if (!$member) {
return sfView::NONE;
}
$community = Doctrine::getTable('Community')->find($request->getParameter('id'));
if (!$community) {
return sfView::ERROR;
}
$isAdmin = Doctrine::getTable('CommunityMember')->isAdmin($member->getId(), $community->getId());
if (!$isAdmin || $community->getImageFileName()) {
return sfView::ERROR;
}
$message = $request->getMailMessage();
if ($images = $message->getImages()) {
$image = array_shift($images);
$validator = new opValidatorImageFile();
$validFile = $validator->clean($image);
$file = new File();
$file->setFromValidatedFile($validFile);
$file->setName('c_' . $community->getId() . '_' . $file->getName());
$community->setFile($file);
$community->save();
}
return sfView::NONE;
}
示例3: executeRegister
/**
* Executes register
*
* @param sfWebRequest A request object
*/
public function executeRegister(sfWebRequest $request)
{
if ($this->getRoute()->getMember()) {
$this->forward('opAuthMailAddress', 'login');
}
$adapter = new opAuthAdapterMailAddress('MailAddress');
if ($adapter->getAuthConfig('invite_mode') < 2) {
return sfView::NONE;
}
$message = $request->getMailMessage();
$this->form = new opRequestRegisterURLForm(null, array('authMode' => 'MailAddress'));
$this->form->bind(array('mail_address' => $message->from));
if ($this->form->isValid()) {
$this->form->sendMail();
}
return sfView::NONE;
}