FriendsOfCake/CakePdf

Override with viewbuilder()->options engine options

admindotnu opened this issue · 2 comments

Is it possible to change line 65 of PdfView.php
$this->pdfConfig = array_merge(
to
$this->pdfConfig = array_merge_recursive(

$this->viewBuilder()->options([ 'pdfConfig' => [ 'engine' => [ 'options' => [ 'header-left' => 'test'] ]] ]);

If its not changed, it completely overrides the engine array.

Thank you.

array_merge_recursive() can have other side effects.
Refs also cakephp/cakephp#7267
Maybe you can look into how merging in Cake works using Hash class?

ADmad commented

Recursive merge would prevent the ability to unset nested keys. Similar issue has already posted earlier (I can't find it right now) and closed.