I am really not sure how to create the block class
Pmm\PmmLayout\Block\Head , function of which
$block->getAllPagesJSContent() should be called inside my phtml file
<referenceBlock name="head.additional"> <block class="Perfectmirrors\PmmLayout\Block\Head" name=""pmm_head" before="-" template="Pmm_Pmmlayout::pmm_head.phtml"/> </referenceBlock>
In the phtml file pmm_head.phtml, I should be able to do something like below to read the contents from a JS file.
$block->getAllPagesJSContent() to output the contents.