Reputation: 28803
How do I show a PNG favicon in CakePHP? I'm currently using $this->Html->meta('icon')
but it looks for .ico
in the root. How do I change it so that it looks for .png
?
Upvotes: 12
Views: 17591
Reputation: 2678
CakePHP 3.5:
echo $this->Html->meta('icon', 'favicon.png', ['type'=>'image/png'])
will generate
<link href="/favicon.png" type="image/png" rel="icon"/>
<link href="/favicon.png" type="image/png" rel="shortcut icon"/>
Upvotes: 5
Reputation: 331
Try to comment out the $this->html->meta('icon')
from the default layout,
this worked for me
Upvotes: 0
Reputation: 480
This would be better to use:
<?php
echo $this->Html->meta('favicon.ico','img/favicon.ico',array('type' => 'icon'));
?>
Upvotes: 8
Reputation: 1623
Ideally you should put your favicon.ico inside webroot folder, cakephp framework will do rest of the things by itself.
Upvotes: 0
Reputation: 3492
I had to put the icon into the /img/ folder - it just wouldn't accept it in the root folder.
Upvotes: 0