PHP Класс Barryvdh\Snappy\PdfWrapper

Автор: Barry vd. Heuvel
Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
$options array
$snappy Knp\Snappy\Pdf

Открытые методы

Метод Описание
__call ( string $name, array $arguments ) : mixed Call Snappy instance.
__construct ( Knp\Snappy\Pdf $snappy )
download ( string $filename = 'document.pdf' ) : Illuminate\Http\Response Make the PDF downloadable by the user
inline ( string $filename = 'document.pdf' ) : Illuminate\Http\Response Return a response with the PDF to show in the browser
loadFile ( string $file ) Load a HTML file
loadHTML ( string $string ) Load a HTML string
loadView ( string $view, array $data = [], array $mergeData = [] ) Load a View and convert to HTML
output ( ) : string Output the PDF as a string.
save ( $filename, $overwrite = false ) Save the PDF to a file
setOption ( string $name, mixed $value )
setOptions ( array $options )
setOrientation ( string $orientation ) Set the orientation (default portrait)
setPaper ( string $paper, string $orientation = null ) Set the paper size (default A4)
setWarnings ( boolean $warnings ) Show or hide warnings
snappy ( ) : Knp\Snappy\Pdf Get the Snappy instance.
stream ( string $filename = 'document.pdf' ) : Symfony\Component\HttpFoundation\StreamedResponse Return a response with the PDF to show in the browser

Описание методов

__call() публичный Метод

Also shortcut's ->html => loadHtml ->view => loadView ->file => loadFile
public __call ( string $name, array $arguments ) : mixed
$name string
$arguments array
Результат mixed

__construct() публичный Метод

public __construct ( Knp\Snappy\Pdf $snappy )
$snappy Knp\Snappy\Pdf

download() публичный Метод

Make the PDF downloadable by the user
public download ( string $filename = 'document.pdf' ) : Illuminate\Http\Response
$filename string
Результат Illuminate\Http\Response

inline() публичный Метод

Return a response with the PDF to show in the browser
public inline ( string $filename = 'document.pdf' ) : Illuminate\Http\Response
$filename string
Результат Illuminate\Http\Response

loadFile() публичный Метод

Load a HTML file
public loadFile ( string $file )
$file string

loadHTML() публичный Метод

Load a HTML string
public loadHTML ( string $string )
$string string

loadView() публичный Метод

Load a View and convert to HTML
public loadView ( string $view, array $data = [], array $mergeData = [] )
$view string
$data array
$mergeData array

output() публичный Метод

Output the PDF as a string.
public output ( ) : string
Результат string The rendered PDF as string

save() публичный Метод

Save the PDF to a file
public save ( $filename, $overwrite = false )
$filename

setOption() публичный Метод

public setOption ( string $name, mixed $value )
$name string
$value mixed

setOptions() публичный Метод

public setOptions ( array $options )
$options array

setOrientation() публичный Метод

Set the orientation (default portrait)
public setOrientation ( string $orientation )
$orientation string

setPaper() публичный Метод

Set the paper size (default A4)
public setPaper ( string $paper, string $orientation = null )
$paper string
$orientation string

setWarnings() публичный Метод

Show or hide warnings
Устаревший:
public setWarnings ( boolean $warnings )
$warnings boolean

snappy() публичный Метод

Get the Snappy instance.
public snappy ( ) : Knp\Snappy\Pdf
Результат Knp\Snappy\Pdf

stream() публичный Метод

Return a response with the PDF to show in the browser
Устаревший: use inline() instead
public stream ( string $filename = 'document.pdf' ) : Symfony\Component\HttpFoundation\StreamedResponse
$filename string
Результат Symfony\Component\HttpFoundation\StreamedResponse

Описание свойств

$options защищенное свойство

protected array $options
Результат array

$snappy защищенное свойство

protected Pdf,Knp\Snappy $snappy
Результат Knp\Snappy\Pdf