I have multiple scriptBlock in my code which is coming from different pages, but it should create one single <script> tag for all JavaScripts written in CakePHP scriptBlock.
My below example code is creating separate <script> Tags for each.
echo $this->Html->scriptBlock(
'jQuery(".investment-table tbody>tr").show()',
['block' => true]
);
echo $this->Html->scriptBlock(
'jQuery(".investment-table tbody>tr").hide()',
['block' => true]
);
echo $this->Html->scriptBlock(
'jQuery(".investment-table tbody>tr").remove()',
['block' => true]
);
Please suggest a proper method to achieve this from many pages.