当前位置: 首页>>代码示例>>PHP>>正文


PHP sfWebRequest::getMailMessage方法代码示例

本文整理汇总了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;
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:28,代码来源:actions.class.php

示例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;
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:27,代码来源:actions.class.php

示例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;
 }
开发者ID:te-koyama,项目名称:openpne,代码行数:22,代码来源:actions.class.php


注:本文中的sfWebRequest::getMailMessage方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。