CakePdf icon indicating copy to clipboard operation
CakePdf copied to clipboard

so that PdfConfig['options'] is merged rather then replaced

Open asmt3 opened this issue 11 years ago • 2 comments

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.

asmt3 avatar May 09 '14 14:05 asmt3

We should add a test case to avoid regression.

dereuromark avatar Jan 31 '16 13:01 dereuromark

Maybe the class should get a InstanceConfigTrait, then people can use config() or configShallow() as they like.

dereuromark avatar Feb 23 '17 13:02 dereuromark