Skip to content

Commit

Permalink
rename PdfResponse to InvoicePdfResponse, which needs template and order
Browse files Browse the repository at this point in the history
  • Loading branch information
MartkCz committed May 4, 2022
1 parent b14a94f commit 662ec19
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@

namespace Contributte\Invoice\Bridge\Nette\Response;

use Contributte\Invoice\Data\IOrder;
use Contributte\Invoice\Templates\ITemplate;
use Nette\Application\Response;
use Nette\Http\IRequest;
use Nette\Http\IResponse;

final class PdfResponse implements Response
final class InvoicePdfResponse implements Response
{

public function __construct(
private string $content,
private ITemplate $template,
private IOrder $order,
)
{
}
Expand All @@ -19,7 +22,7 @@ public function send(IRequest $httpRequest, IResponse $httpResponse): void
{
$httpResponse->setContentType('application/pdf', 'utf-8');

echo $this->content;
echo $this->template->renderToPdf($this->order);
}

}

0 comments on commit 662ec19

Please sign in to comment.