20

これはばかげた質問だと思いますが、答えはどこにも見つかりません。Codeigniterを使用している場合、ファビコンファイルをブラウザにポップアップ表示されるように保存するにはどうすればよいですか?または、まだ見つけられていないファイルに構成オプションがありますか?これは私を夢中にさせています!

助けてくれてありがとう。

4

3 に答える 3

33

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

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">

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.

于 2010-08-13T16:36:00.377 に答える
3

HTMLヘルパーをロード<?php echo link_tag('favicon.ico', 'shortcut icon', 'image/ico'); ?>して、<head>htmlタグで使用できます。詳細については、http://codeigniter.com/user_guide/helpers/html_helper.html#link_tagをご覧ください。

于 2011-02-12T17:36:42.543 に答える
2

私はこれを私のコードで使用しましたが、正常に機能しています

<pre>
<link rel="icon" href="<?php echo base_url(); ?>favicon.ico" type="image/gif">
</pre>
于 2014-06-28T07:38:33.623 に答える