Download the PHP package joseki/text-as-file-response without Composer
On this page you can find all versions of the php package joseki/text-as-file-response. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download joseki/text-as-file-response
More information about joseki/text-as-file-response
Files in joseki/text-as-file-response
Download joseki/text-as-file-response
More information about joseki/text-as-file-response
Files in joseki/text-as-file-response
Vendor joseki
Package text-as-file-response
Short Description Text as file response extension for Nette Framework
License MIT
Package text-as-file-response
Short Description Text as file response extension for Nette Framework
License MIT
Please rate this library. Is it a good library?
Informations about the package text-as-file-response
TextAsFileResponse
Text as file response for Nette Framework
Install
Installation via Composer.
{
"require":{
"joseki/text-as-file-response": "@dev"
}
}
Download a file from a template
// in a Presenter
public function actionDownload()
{
$template = $this->createTemplate();
$template->setFile("/path/to/template.latte");
$template->someValue = 123;
$response = new Joseki\Application\Responses\TextAsFileResponse($template, 'MyFilename.txt');
$this->sendResponse($response);
}
Download a file from a string
// in a Presenter
public function actionDownload()
{
$data = 'lorem ipsum...';
$response = new Joseki\Application\Responses\TextAsFileResponse($data, 'MyFilename.txt');
$this->sendResponse($response);
}
Setting content type
// in a Presenter
public function actionDownload()
{
$response = new Joseki\Application\Responses\TextAsFileResponse($data, 'MyFilename.xml', 'application/xml');
$this->sendResponse($response);
}
All versions of text-as-file-response with dependencies
PHP Build Version
Package Version
Requires
nette/application Version
~2.2
The package joseki/text-as-file-response contains the following files
Loading the files please wait ....