PHP Class Bkwld\Croppa\Handler

Inheritance: extends Illuminate\Routing\Controller
Show file Open project: bkwld/croppa

Public Methods

Method Description
__construct ( URL $url, Bkwld\Croppa\Storage $storage, Illuminate\Http\Request $request, array $config = null ) Dependency injection
getContentType ( string $path ) : string Symfony kept returning the MIME-type of my testing jpgs as PNGs, so determining it explicitly via looking at the path name.
handle ( string $request ) : Symfony\Component\HttpFoundation\StreamedResponse Handles a Croppa style route
render ( string $request_path ) : string Render image directly

Method Details

__construct() public method

Dependency injection
public __construct ( URL $url, Bkwld\Croppa\Storage $storage, Illuminate\Http\Request $request, array $config = null )
$url URL
$storage Bkwld\Croppa\Storage
$request Illuminate\Http\Request
$config array

getContentType() public method

Symfony kept returning the MIME-type of my testing jpgs as PNGs, so determining it explicitly via looking at the path name.
public getContentType ( string $path ) : string
$path string
return string

handle() public method

Handles a Croppa style route
public handle ( string $request ) : Symfony\Component\HttpFoundation\StreamedResponse
$request string The `Request::path()`
return Symfony\Component\HttpFoundation\StreamedResponse

render() public method

Render image directly
public render ( string $request_path ) : string
$request_path string The `Request::path()`
return string The path, relative to the storage disk, to the crop