<?php
echo $this->Html->css(
array(
'/printPlugin/css/960',
'/printPlugin/css/screen',
'/printPlugin/css/print',
'/printPlugin/src/css/print-preview'
)
);
?>
This code produce following HTML:
<link rel="stylesheet" type="text/css" href="/demo-home22/printPlugin/css/960.css" />
<link rel="stylesheet" type="text/css" href="/demo-home22/printPlugin/css/screen.css" />
<link rel="stylesheet" type="text/css" href="/demo-home22/printPlugin/css/print.css" />
<link rel="stylesheet" type="text/css" href="/demo-home22/printPlugin/src/css/print-preview.css" />
My expected output is:
<link rel="stylesheet" type="text/css" href="/demo-home22/printPlugin/css/960.css" media="screen"/>
<link rel="stylesheet" type="text/css" href="/demo-home22/printPlugin/css/screen.css" media="screen" />
<link rel="stylesheet" type="text/css" href="/demo-home22/printPlugin/css/print.css" media="print" />
<link rel="stylesheet" type="text/css" href="/demo-home22/printPlugin/src/css/print-preview.css" media="screen"/>
That means I would like to add media="screen"
in each CSS link.
N.B: I am using cakePHP 3
Here you can use
<?php echo $this->Html->css(['mycss'],['media' => 'print']); ?>
Output will like this html
<link rel="stylesheet" href="/myproject/css/mycss.css" media="print"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With