Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public function upload()
- {
- if ($this->validate()) {
- foreach ($this->image as $item) {
- $baseName = $this->image->getBaseName() . "." . $this->image->getExtension();
- $fileName = '@imgPath' . $baseName;
- $item->saveAs(Yii::getAlias($fileName));
- //$this->image->saveAs(Yii::getAlias('@imgPath') . $this->image->photo . '.' . $this->image->extension);
- }
- return true;
- } else {
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement