So far I can only load a specific CSS file for a specific action by include that CSS file within tag from the corresponding view file. But I want t
In your template, this can be achieved by linking to the css file using the block option:
Creates a link(s) to a CSS style-sheet. If the block option is set to true, the link tags are added to the css block which you can print inside the head tag of the document.
I.e. anywhere in the relevant template:
$this->Html->css('special', ['block' => true]);
This is output by the fetch call in the layout:
<?= $this->fetch('css') ?>