Example #1
0
 public function run()
 {
     if (false !== empty($this->avatar) && strtolower(pathinfo($this->avatar, PATHINFO_EXTENSION)) != 'jpg') {
         //'avatar filetype must be jpg'
         $this->avatar = null;
     } else {
         $this->avatar = Yii::getAlias($this->avatar);
         if (!file_exists($this->avatar)) {
             $this->avatar = null;
         }
     }
     $formatter = new FormatCard(['name' => $this->name, 'phone' => $this->phone, 'avatar' => $this->avatar]);
     $this->text = $formatter->format();
     return parent::run();
 }
Example #2
0
 public function run()
 {
     $formatter = new FormatEmail(['email' => $this->email, 'subject' => $this->subject, 'body' => $this->body]);
     $this->text = $formatter->format();
     return parent::run();
 }
Example #3
0
 public function run()
 {
     $formatter = new FormatTel(['phone' => $this->phone]);
     $this->text = $formatter->format();
     return parent::run();
 }