如何在Codeigniter中设置Favicon [英] How to set Favicon in Codeigniter

查看:126
本文介绍了如何在Codeigniter中设置Favicon的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我知道这是一个愚蠢的问题,但我在任何地方都找不到答案。如果我使用Codeigniter,我在哪里保存我的favicon文件,以便它会弹出在浏览器?或者在文件中有一个配置选项,我还没有找到呢?这让我疯了!

I know this is a stupid question, but I can't find the answer anywhere. If I'm using Codeigniter, where do I save my favicon file so that it will pop up in the browser? Or is there a config option in the files that I haven't been able to find yet? This is driving me crazy!

非常感谢您的帮助。

推荐答案

这取决于您的组织。我通常把favicon.gif文件放在web根文件夹,所以URL将 yourdomain.com/favicon.gif

It depends on your organization. I usually put the favicon.gif file in the web root folder, so the URL would be yourdomain.com/favicon.gif

然后,您必须将以下代码行添加到您的HTML < head>

Then you have to add the following line of code into your HTML <head>:

<link rel="icon" href="<?=base_url()?>/favicon.gif" type="image/gif">

假设在CodeIgniter中加载了URL Helper。您可以通过 $ this-> load-> helper('url'); 加载它或将其添加到config文件夹中的自动加载辅助程序数组。

Assuming that the URL Helper is loaded in CodeIgniter. You can load it via $this->load->helper('url'); or add it into the autoload helper array in your config folder.

这篇关于如何在Codeigniter中设置Favicon的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆