Controller/AzineEmailTemplateController.php
public function serveImageAction(Request $request, $folderKey, $filename)
    {
        $folder = $this->getTemplateProviderService()->getFolderFrom($folderKey);
        if (false !== $folder) {
            $fullPath = $folder.urldecode($filename);
            $response = BinaryFileResponse::create($fullPath);
            $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_INLINE);
            $response->headers->set('Content-Type', 'image');

            return $response;
        }

        throw new FileNotFoundException($filename);
    }
public function serveImageAction(Request $request, $folderKey, $filename)
    {
        $folder = $this->getTemplateProviderService()->getFolderFrom($folderKey);
        if (false !== $folder) {
            $fullPath = $folder.urldecode($filename);
            $response = BinaryFileResponse::create($fullPath);
            $response->setContentDisposition(ResponseHeaderBag::DISPOSITION_INLINE);
            $response->headers->set('Content-Type', 'image');

            return $response;
        }

        throw new FileNotFoundException($filename);
    }
public function serveImageAction ( Request $ request , $ folderKey , $ filename ) { $ folder = $ this -> getTemplateProviderService ( ) -> getFolderFrom ( $ folderKey ) ; if ( false !== $ folder ) { $ fullPath = $ folder . urldecode ( $ filename ) ; $ response = BinaryFileResponse :: create ( $ fullPath ) ; $ response -> setContentDisposition ( ResponseHeaderBag :: DISPOSITION_INLINE ) ; $ response -> headers -> set ( 'Content-Type' , 'image' ) ; return $ response ; } throw new FileNotFoundException ( $ filename ) ; }
Serve the image from the templates-folder.

@param Request $request
@param string  $folderKey
@param string  $filename

@return BinaryFileResponse
Serve the image from the templates - folder .