Advertisement
Guest User

Untitled

a guest
Jun 26th, 2019
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. public function upload()
  2. {
  3. if ($this->validate()) {
  4.  
  5. foreach ($this->image as $item) {
  6.  
  7. $baseName = $this->image->getBaseName() . "." . $this->image->getExtension();
  8.  
  9. $fileName = '@imgPath' . $baseName;
  10.  
  11. $item->saveAs(Yii::getAlias($fileName));
  12. //$this->image->saveAs(Yii::getAlias('@imgPath') . $this->image->photo . '.' . $this->image->extension);
  13. }
  14. return true;
  15. } else {
  16. return false;
  17. }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement