Yii ?????? PHP ?? ??? MVC ????????. ?? ??? ?? ??, ??? ? ??????. ? ??? ???? ?? ??? ? ????? ???? ?????. ? ????? Yii ??????? ?? ??? ? ????? ???? ??? ?????.
1. ?? ???
1. ??
??? ????? ?? ?? ??? ???? ???. config/main.php ??? ?? ?? ??? ?? ??? ?????.
'components' => [ ????? 'request' => [ ??????? 'parsers' => [ ????????? 'application/json' => 'yiiwebJsonParser', ????????? 'multipart/form-data' => 'yiiwebMultipartFormDataParser', ??????? ], ????? ], ?????? 'request' => [ ??????? 'enableCsrfCookie' => false, ??????? 'enableCsrfValidation' => false, ??????? 'parsers' => [ ????????? 'multipart/form-data' => 'yiiwebMultipartFormDataParser', ??????? ], ????? ], ?????? 'urlManager' => [ ??????? 'enablePrettyUrl' => true, ??????? 'showScriptName' => false, ??????? 'rules' => [ ??????? ], ????? ], ? ? ],
?? ??? ? ?? ?? ?? ??, ? ?? ? ???CsrfValidation? ?????. ??? ??? ?????. multipart/form-data? ???? ?? ???? ?????. ???CsrfValidation? CSRF ??? ?? ?? ?????.
2. ?? ??? ??
?????? ?? ???? ???? ?? ?? ?? Ajax ???? ??? ? ????. ???? ?? ??? ?? ???????.
public function actionUpload() ??? { ??????? $uploadModel = new UploadForm(); ? ??????? if (Yii::$app->request->isPost) { ??????????? $uploadModel->file = UploadedFile::getInstance($uploadModel, 'file'); ??????????? if ($uploadModel->upload()) { ??????????????? // file is uploaded successfully ??????????????? return; ??????????? } ??????? } ? ??????? return $this->render('upload', ['model' => $uploadModel]); ??? }
actionUpload??? ?? ???? ?? ?? ??? UploadForm? ????????. ??? Yii::$app->request->isPost? ???? POST ???? ??? ?????. ???? Yii::$app->request->getInstance() ???? ??? ????. ?? ??? ?? ?? ????, upload() ???? ???? ??? ??????. ???? ???? true? ????, ???? false? ?????.
UploadForm ???? ?? ??? ??? ????.
class UploadForm extends yiiaseModel ??? { ??????? /** ???????? * @var UploadedFile file attribute ???????? */ ??????? public $file; ? ? ??????? /** ???????? * @return array the validation rules. ???????? */ ??????? public function rules() ??????? { ??????????? return [ ??????????????? [['file'], 'file'], ??????????? ]; ??????? } ? ??????? public function upload() ??????? { ??????????? if ($this->validate()) { ??????????????? $filePath = 'uploads/' . $this->file->baseName . '.' . $this->file->extension; ??????????????? $this->file->saveAs($filePath); ??????????????? return true; ??????????? } else { ??????????????? return false; ??????????? } ??????? } ??? }
UploadForm??? ???? ??? ???? ?? ?? ?? ??? ?????. ??? ?? ??? ???? ??? ????, ??? ??? ? ??? ??????. ?? ??? ??? $this->file->extension???.
3. ?? ???? ??
?? ???? ??? ????? ??? ?????. ?????? ?? ?? ???? ????? ?? ???.
public function actionDownload($file) ??? { ??????? Yii::$app->response->sendFile($file); ??? }
actionDownload?? Yii::$app->response->sendFile() ???? ???? ?? ???? ?????. ??? $file? ?? ?????.
2. ??
? ????? Yii ??????? ?? ??? ? ???? ??? ???? ??? ?????. ?? ?? ??? ? ????? ?? ?? ??? ?? ??, ?? ? ??? ?????. ? ?? ??? ?? Yii ???????? ?? ??? ?? ? ?? ???? ????? ?? ??? ?? ???? ??? ??? ? ????.
? ??? Yii ??????? ?? ??? ? ????: ?? ?? ?? ??? ?? ?????. ??? ??? PHP ??? ????? ?? ?? ??? ?????!

? AI ??

Undress AI Tool
??? ???? ??

Undresser.AI Undress
???? ?? ??? ??? ?? AI ?? ?

AI Clothes Remover
???? ?? ???? ??? AI ?????.

Clothoff.io
AI ? ???

Video Face Swap
??? ??? AI ?? ?? ??? ???? ?? ???? ??? ?? ????!

?? ??

??? ??

???++7.3.1
???? ?? ?? ?? ???

SublimeText3 ??? ??
??? ??, ???? ?? ????.

???? 13.0.1 ???
??? PHP ?? ?? ??

???? CS6
??? ? ?? ??

SublimeText3 Mac ??
? ??? ?? ?? ?????(SublimeText3)

Workerman ???? ?? ??? ? ????? ????? ?? ?? ??? ?????. ??: Workerman? ???? ????? ???? ?? ??? PHP ??? ???? ?? ????????. ?? ???? ?? ??? ? ????? ???? ?? ?? ?????. ? ????? Workerman ?????? ???? ?? ??? ? ????? ???? ??? ???? ???? ?? ??? ?????. 1. ?? ???: ?? ???? ?? ???? ?? ??? ??? ???? ??? ????. ??? ?????

Python? ????? ??? ? ? ?? ?? ??? ?????: open() ??: ??? ??? ??(?: 'r', 'w', 'a')? ???? ??? ???. ?? ?????: download() ???? ???? ???? ??? ???? ??? ?? ???. Pathlib ?????: write_bytes() ? read_text() ???? ???? ?? ??? ?? ????.

Laravel? ???? ?? ??? ? ???? ??? ???? ?? Laravel? ? ??????? ?? ?? ????? ??? ? ??? ??? ??? ??? ???? ?? ?? PHP ? ????????. ????? ???? ?? ? ??? ?? ??? ? ???????. ? ???? Laravel? ???? ?? ??? ? ???? ??? ???? ??? ???? ???? ?? ??? ?????. ?? ??? ?? ???? ?? ??? ??? ????? ???? ?? ????. Laravel??? ?? ???? ??? ? ????.

???? ?? ?? ????? ?? ???? ??? ????? ????? ? ????. ?? ?? ?? ?? ??? ???? ???? ?? ???? ??? ?? ??? ???? ? ????. ?? ?? ?? ??? ???? ???? ????? ? ?? ???? ?????. ??? inputtypefile? ???? ?? ??? ??? ??? ??? ?? ??? JavaScript/JQuery? ???? ?? ???? ??? ??? ??? ?? ???? ?? ????. ? ??????? HTML ???? JavaScript? ??? ? ?? ????? ????? ??? ??? ?????. <a> ??? ??? ??? HTML? <a> ??? ???? ??? ???? ??? ??? ? ?? ????? ?????.

?? ????? ?? Hyperf ?????? ???? ?? ??: ?? ????? Hyperf ?????? ???? ? ??????? ??? ? ???? ?? ?????. ? ????? ?? ?? ??? ???? ?? ????? Hyperf ?????? ???? ??? ?????. 1. ?? ???? ?? Hyperf ?????? ???? Hyperf ??????? ????? ????? ?????. 2. ?? ???? ???? ?? ?? ?? ???? ??? ??? ????? ???? ???. ???? ?? ?????

??: ?, Golang? ?? ??? ??? ????? ??? ?????. ?? ??: MultipartFile ??? ?? ????? ? ???? ?? ???? ?????. FormFile ??? ?? ???? ?? ??? ?????. ParseForm ? ParseMultipartForm ??? ?? ???? ?? ?? ?? ???? ?? ???? ? ?????. ??? ??? ???? ?? ?? ????? ????? ???? ???? ??? ??? ? ????.

gRPC? ???? ?? ???? ???? ??? ?????? ?? ? ?? ???? ???? ?? ??? ??? ????. ???????? ???? ??? ??? ??? ??? ?? gRPC ???? ?? ??? ???????. ?? ???? ?? ??? ???? ??? ?????. ??? ?? ???? ??? ? ??? ?? ??? ???? ??? ????.

?? ???? ?? Hyperf ?????? ????? ?? ?? ??? ?????. ??: ? ??????? ????? ?? ??? ??? ?? ?????? ???? ?? ??? ?????. Hyperf? ?? ???? ???? ??? ?? ??? ???? ??? PHP ??????? ????????. ? ????? ?? ???? ?? Hyperf ?????? ???? ??? ???? ?? ?? ??? ?????. 1. Hyperf ????? ??: ?? Hyperf ?????? ???? ???. ????? ??? ? ????.
