-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ca4affa
commit 2492276
Showing
4 changed files
with
78 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -131,6 +131,22 @@ function favicon_url($uri = '', $protocol = null) | |
return assets_url($uri, $protocol); | ||
} | ||
} | ||
if (!function_exists('favicon_html_tag')) { | ||
/** | ||
* Function favicon_html_tag | ||
* | ||
* @param $baseUrl | ||
* | ||
* @return string | ||
* @author : 713uk13m <[email protected]> | ||
* @copyright: 713uk13m <[email protected]> | ||
* @time : 30/12/2022 03:21 | ||
*/ | ||
function favicon_html_tag($baseUrl = '') | ||
{ | ||
return (new \nguyenanhung\CodeIgniter\BasicHelper\Favicon())->faviconHtml($baseUrl); | ||
} | ||
} | ||
if (!function_exists('storage_url')) { | ||
/** | ||
* Function storage_url | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,8 +19,8 @@ | |
*/ | ||
class BaseHelper | ||
{ | ||
const VERSION = '1.1.7.1'; | ||
const LAST_MODIFIED = '2022-12-26'; | ||
const VERSION = '1.1.7.2'; | ||
const LAST_MODIFIED = '2022-12-30'; | ||
const AUTHOR_NAME = 'Hung Nguyen'; | ||
const AUTHOR_EMAIL = '[email protected]'; | ||
const PROJECT_NAME = 'CodeIgniter - Basic Helper'; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
<?php | ||
/** | ||
* Project codeigniter-basic-helper | ||
* Created by PhpStorm | ||
* User: 713uk13m <[email protected]> | ||
* Copyright: 713uk13m <[email protected]> | ||
* Date: 30/12/2022 | ||
* Time: 09:36 | ||
*/ | ||
|
||
namespace nguyenanhung\CodeIgniter\BasicHelper; | ||
|
||
/** | ||
* Class Favicon | ||
* | ||
* @package nguyenanhung\CodeIgniter\BasicHelper | ||
* @author 713uk13m <[email protected]> | ||
* @copyright 713uk13m <[email protected]> | ||
*/ | ||
class Favicon extends BaseHelper | ||
{ | ||
/** | ||
* Function faviconHtml | ||
* | ||
* Function này hỗ trợ return ra 1 đoạn HTML dùng show Favicon, được build từ https://www.favicon-generator.org/ | ||
* | ||
* @param $baseUrl | ||
* | ||
* @return string | ||
* @author : 713uk13m <[email protected]> | ||
* @copyright: 713uk13m <[email protected]> | ||
* @time : 30/12/2022 00:06 | ||
* | ||
* @see : https://www.favicon-generator.org/ | ||
*/ | ||
public function faviconHtml($baseUrl = '') | ||
{ | ||
$baseUrl = trim($baseUrl) . '/'; | ||
$html = '<link rel="apple-touch-icon" sizes="57x57" href="' . $baseUrl . 'apple-icon-57x57.png">' . PHP_EOL; | ||
$html .= '<link rel="apple-touch-icon" sizes="60x60" href="' . $baseUrl . 'apple-icon-60x60.png">' . PHP_EOL; | ||
$html .= '<link rel="apple-touch-icon" sizes="72x72" href="' . $baseUrl . 'apple-icon-72x72.png">' . PHP_EOL; | ||
$html .= '<link rel="apple-touch-icon" sizes="76x76" href="' . $baseUrl . 'apple-icon-76x76.png">' . PHP_EOL; | ||
$html .= '<link rel="apple-touch-icon" sizes="114x114" href="' . $baseUrl . 'apple-icon-114x114.png">' . PHP_EOL; | ||
$html .= '<link rel="apple-touch-icon" sizes="120x120" href="' . $baseUrl . 'apple-icon-120x120.png">' . PHP_EOL; | ||
$html .= '<link rel="apple-touch-icon" sizes="144x144" href="' . $baseUrl . 'apple-icon-144x144.png">' . PHP_EOL; | ||
$html .= '<link rel="apple-touch-icon" sizes="152x152" href="' . $baseUrl . 'apple-icon-152x152.png">' . PHP_EOL; | ||
$html .= '<link rel="apple-touch-icon" sizes="180x180" href="' . $baseUrl . 'apple-icon-180x180.png">' . PHP_EOL; | ||
$html .= '<link rel="icon" type="image/png" sizes="192x192" href="' . $baseUrl . 'android-icon-192x192.png">' . PHP_EOL; | ||
$html .= '<link rel="icon" type="image/png" sizes="32x32" href="' . $baseUrl . 'favicon-32x32.png">' . PHP_EOL; | ||
$html .= '<link rel="icon" type="image/png" sizes="96x96" href="' . $baseUrl . 'favicon-96x96.png">' . PHP_EOL; | ||
$html .= '<link rel="icon" type="image/png" sizes="16x16" href="' . $baseUrl . 'favicon-16x16.png">' . PHP_EOL; | ||
$html .= '<link rel="manifest" href="' . $baseUrl . 'manifest.json">' . PHP_EOL; | ||
$html .= '<meta name="msapplication-TileColor" content="#ffffff">' . PHP_EOL; | ||
$html .= '<meta name="msapplication-TileImage" content="' . $baseUrl . 'ms-icon-144x144.png">' . PHP_EOL; | ||
$html .= '<meta name="theme-color" content="#ffffff">' . PHP_EOL; | ||
|
||
return $html; | ||
} | ||
} |