What's the best way of handling a favicon.ico in Zend framework? I have seen alternatives that requires modification of phtml files like:
$this->headLink()->headLink(array('rel' => 'favicon',
'href' => '/img/favicon.ico'),
'PREPEND')
or modifications on .htaccess file.
Thanks,
Three choices:
<link>
tag into your layoutPersonally I would go for option 2. There's little point programmatically adding the favicon if it will always be there. It might make sense if the favicon was different for different users, e.g. say your application had a themes system with different favicons for different themes, then you might want to use headLink().
Browsers tend to cache favicons for a long time, so as long as the link tag is appearing in your HTML source then it will eventually update. You can speed up the process by changing the filename, viewing the favicon directly in your browser and/or clearing your browser cache.
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