public function actionImages(): Response
    {
        $result = [];

        foreach (AttachmentModel::find()->each() as $attachment) {
            $result[] = [
                'id' => $attachment->id,
                'url' => $attachment->getFileUrl('origin'),
                'thumb' => $attachment->getFileUrl('thumbnail'),
            ];
        }

        return $this->asJson($result);
    }
public function actionImages(): Response
    {
        $result = [];

        foreach (AttachmentModel::find()->each() as $attachment) {
            $result[] = [
                'id' => $attachment->id,
                'url' => $attachment->getFileUrl('origin'),
                'thumb' => $attachment->getFileUrl('thumbnail'),
            ];
        }

        return $this->asJson($result);
    }
public function actionImages ( ) : Response { $ result = [ ] ; foreach ( AttachmentModel :: find ( ) -> each ( ) as $ attachment ) { $ result [ ] = [ 'id' => $ attachment -> id , 'url' => $ attachment -> getFileUrl ( 'origin' ) , 'thumb' => $ attachment -> getFileUrl ( 'thumbnail' ) , ] ; } return $ this -> asJson ( $ result ) ; }
Return list of all images

@return Response
Return list of all images