CakePdf
CakePdf copied to clipboard
so that PdfConfig['options'] is merged rather then replaced
If my controller has:
$this->pdfConfig = array(
'options' => array(
'footer-html' => '/pdfparts/foot/' . $id,
),
);
This change means that my existing configuration options:
Configure::write('CakePdf', array(
'engine' => 'CakePdf.WkHtmlToPdf',
'options' => array(
'print-media-type' => false,
'outline' => true,
'dpi' => 96,
'header-spacing' => 30,
),
'margin' => array(
'bottom' => 10,
'left' => 10,
'right' => 10,
'top' => 45
),
'orientation' => 'portrait',
'download' => true,
));
won't be overwritten. They'll be merged instead.
We should add a test case to avoid regression.
Maybe the class should get a InstanceConfigTrait, then people can use config() or configShallow() as they like.