1
0
mirror of https://github.com/letrunghieu/favicon.git synced 2025-01-16 20:28:20 +01:00

Support functional helper

This commit is contained in:
Hieu Le 2015-03-18 16:02:50 +07:00
parent 0f5d5d57f1
commit 1330846d1d
3 changed files with 42 additions and 5 deletions

View File

@ -22,18 +22,19 @@
"symfony/console": "~2.0"
},
"suggest": {
"ext-imagick": "To use the binary and generate favicon images"
},
"ext-imagick": "To use the binary and generate favicon images"
},
"bin": [
"favicon"
],
"favicon"
],
"config": {
"bin-dir": "bin"
},
"autoload": {
"psr-4": {
"HieuLe\\Favicon\\": "src/"
}
},
"files": ["src/helpers.php"]
},
"require-dev": {
"phpunit/phpunit": "~4.0"

View File

@ -10,6 +10,18 @@ namespace HieuLe\Favicon;
class Html
{
/**
* Write meta and link tags
*
* @param bool $noOldApple exclude old apple touch link
* @param bool $noAndroid exclude android manifest.json file
* @param bool $noMs exclude msapplication meta tags
* @param tring $tileColor the color of Windows tile
* @param string $browserConfigFile the path to browserconfig.xml file or null to disable this
* @param string $appName the name of application when pinned
*
* @return string
*/
public static function output($noOldApple = false, $noAndroid = false, $noMs = false, $tileColor = '#FFF', $browserConfigFile = '', $appName = '')
{
$result = array();

24
src/helpers.php Normal file
View File

@ -0,0 +1,24 @@
<?php
if (!function_exists('favicon'))
{
/**
* Write meta and link tags
*
* @param bool $noOldApple exclude old apple touch link
* @param bool $noAndroid exclude android manifest.json file
* @param bool $noMs exclude msapplication meta tags
* @param tring $tileColor the color of Windows tile
* @param string $browserConfigFile the path to browserconfig.xml file or null to disable this
* @param string $appName the name of application when pinned
*
* @return string
*/
function favicon($noOldApple = false, $noAndroid = false, $noMs = false, $tileColor = '#FFF', $browserConfigFile = '', $appName = '')
{
return HieuLe\Favicon\Html::output($noOldApple, $noAndroid, $noMs, $tileColor, $browserConfigFile, $appName);
}
}