File: /var/www/vhosts/creativefellows.nl/jhtaxatie.creativefellows.nl/classes/LabelController.php
<?php
/**
* Description
*/
class LabelController extends BaseController
{
function __construct($db_connection,$router,$user_id,$view=null,$user_role=null,$settings=null)
{
$this->db = $db_connection;
$this->router = $router;
$this->view = $view;
$this->user_role = $user_role;
$this->user_id = $user_id;
$this->settings = $settings;
$this->baseUrl = $this->settings['baseUrl'];
$this->siteUrl = $this->settings['siteUrl'];
$this->fields = $this->settings['inspection_fields'];
}
/*
* get pdf with generated data
*/
public function getPdf($request, $response, $args)
{
$label = new LabelPdf($this->settings["font_folder"],$args);
$label->setSourceFile($this->settings["stellingen_pdf_tp"]);
$pdf_label = $label->create("I");
$response->getBody()->write( $pdf_label );
$response = $response->withHeader( 'Content-type', 'application/pdf' );
return $response;
}
}
?>