Elgg  Version 6.1
favicon.ico.php
Go to the documentation of this file.
1 <?php
6 elgg_set_http_header('Expires: ' . gmdate('D, d M Y H:i:s \G\M\T', strtotime('+1 week')), true);
7 elgg_set_http_header('Pragma: public', true);
8 elgg_set_http_header('Cache-Control: public', true);
9 
11 if ($site->hasIcon('icon-32', 'favicon')) {
12  elgg_set_http_header('Content-Type: image/jpeg');
13 
14  echo $site->getIcon('icon-32', 'favicon')->grabFile();
15 
16  return;
17 }
18 
19 elgg_set_http_header('Content-Type: image/x-icon');
20 
21 echo elgg_view('graphics/favicon.ico');
elgg_set_http_header(string $header, bool $replace=true)
Set a response HTTP header.
Definition: elgglib.php:26
$site
Definition: favicon.ico.php:10
elgg_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
elgg_get_site_entity()
Get the current site entity.
Definition: entities.php:101