Use Composer to install this library from Packagist:
elephpant/favicon
Run the following command from your project directory to add the dependency:
composer require elephpant/favicon "^1.0"
Alternatively, add the dependency directly to your composer.json
file:
"require": {
"elephpant/favicon": "^1.0"
}
<?php
use ElePHPant\Favicon\Favicon;
// ORIGINAL IMAGE (recommended minimum size: 310x310 px), FOLDER, SITE URL
$favicon = (new Favicon('source.png', 'img/ico', 'https://site.com'))
->favicon()
->render();
<head>
<meta charset="UTF-8">
<title>Document</title>
<!-- ========== Favicon ========== -->
<?= $favicon; ?>
</head>
<head>
<meta charset="UTF-8">
<title>Document</title>
<!-- ========== Favicon ========== -->
<link rel="apple-touch-icon-precomposed" href="https://site.com/img/ico/apple-touch-icon-57x57.png" sizes="57x57"/>
<link rel="apple-touch-icon-precomposed" href="https://site.com/img/ico/apple-touch-icon-114x114.png" sizes="114x114"/>
<link rel="apple-touch-icon-precomposed" href="https://site.com/img/ico/apple-touch-icon-72x72.png" sizes="72x72"/>
<link rel="apple-touch-icon-precomposed" href="https://site.com/img/ico/apple-touch-icon-144x144.png" sizes="144x144"/>
<link rel="apple-touch-icon-precomposed" href="https://site.com/img/ico/apple-touch-icon-60x60.png" sizes="60x60"/>
<link rel="apple-touch-icon-precomposed" href="https://site.com/img/ico/apple-touch-icon-120x120.png" sizes="120x120"/>
<link rel="apple-touch-icon-precomposed" href="https://site.com/img/ico/apple-touch-icon-76x76.png" sizes="76x76"/>
<link rel="apple-touch-icon-precomposed" href="https://site.com/img/ico/apple-touch-icon-152x152.png" sizes="152x152"/>
<link rel="icon" href="https://site.com/img/ico/favicon-196x196.png" sizes="196x196" type="image/png"/>
<link rel="icon" href="https://site.com/img/ico/favicon-96x96.png" sizes="96x96" type="image/png"/>
<link rel="icon" href="https://site.com/img/ico/favicon-32x32.png" sizes="32x32" type="image/png"/>
<link rel="icon" href="https://site.com/img/ico/favicon-16x16.png" sizes="16x16" type="image/png"/>
<link rel="icon" href="https://site.com/img/ico/favicon-128x128.png" sizes="128x128" type="image/png"/>
<meta name="application-name" content="&nbsp;"/>
<meta name="msapplication-TileColor" content="#FFFFFF"/>
<meta name="msapplication-TileImage" content="https://site.com/img/ico/mstile-144x144.png"/>
<meta name="msapplication-square70x70logo" content="https://site.com/img/ico/mstile-70x70.png"/>
<meta name="msapplication-square150x150logo" content="https://site.com/img/ico/mstile-150x150.png"/>
<meta name="msapplication-wide310x150logo" content="https://site.com/img/ico/mstile-310x150.png"/>
<meta name="msapplication-square310x310logo" content="https://site.com/img/ico/mstile-310x310.png"/>
</head>
<meta name="msapplication-notification" content="frequency=30;polling-uri=https://notifications.buildmypinnedsite.com/?feed=https://site.com/rss.xml.xml&id=1;polling-uri2=https://notifications.buildmypinnedsite.com/?feed=https://site.com/rss.xml.xml&id=2;polling-uri3=https://notifications.buildmypinnedsite.com/?feed=https://site.com/rss.xml.xml&id=3;polling-uri4=https://notifications.buildmypinnedsite.com/?feed=https://site.com/rss.xml.xml&id=4;polling-uri5=https://notifications.buildmypinnedsite.com/?feed=https://site.com/rss.xml.xml&id=5;cycle=1"/>
No one ever has enough engineers, so we're very happy to accept contributions via Pull Requests. For details, see CONTRIBUTING
- Wilder Amorim (Developer)
- All Contributors (This Rock)
The MIT License (MIT). Please see License File for more information.