Of course, You maybe put favicon five in another folder in your web resources folder. For example: put favicon.ico in /app/webroot/img/decor/favicon.ico :
More information: "favicon.ico" is the convention. Don't chage file name. Create or choose a favicon: http://www.favicon.cc/ Or see HTML source (Ctrl + U) from another website, and copy & paste.
Simply replace the favicon inside app/webroot with your own *.ico favicon. And you're done ! If your favicon won't show after you done as above, Re-refresh your browser Or, simply clear web history.
Well you need to delete the default favicon.ico icon file from webroot directory and place your own picture. But make sure you convert that picture in icon format and rename it to favicon. I think it should work because it worked for me.
发布评论
评论(12)
只需将文件
app/webroot/favicon.ico
替换为您自己的版本即可。Simply replace the file
app/webroot/favicon.ico
with your own version.使用
Html Helper
,将其放入标签中:
(文件
/app/View/Layouts/default.ctp
)你也可以使用超链接,例如我使用StackOver Flow的favicon:
当然,你可以将favicon 5放在Web资源文件夹中的另一个文件夹中。例如:将 favicon.ico 放入
/app/webroot/img/decor/favicon.ico
:更多信息:“favicon.ico”是约定。不要更改文件名。
创建或选择一个图标: http://www.favicon.cc/ 或查看 HTML 源代码 (Ctrl + U )从另一个网站,并复制并粘贴。
使用 CakePHP 最新版本 (2.6.0)。参考: http://book .cakephp.org/2.0/en/core-libraries/helpers/html.html#inserting-well-formatted-elements
Use
Html Helper
, put it in<head>
tag:(File
/app/View/Layouts/default.ctp
)You also use hyperlink, for example, I used StackOver Flow's favicon:
Of course, You maybe put favicon five in another folder in your web resources folder. For example: put favicon.ico in
/app/webroot/img/decor/favicon.ico
:More information: "favicon.ico" is the convention. Don't chage file name.
Create or choose a favicon: http://www.favicon.cc/ Or see HTML source (Ctrl + U) from another website, and copy & paste.
Work with CakePHP lastest version (2.6.0). Reference: http://book.cakephp.org/2.0/en/core-libraries/helpers/html.html#inserting-well-formatted-elements
只需将 app/webroot 中的图标替换为您自己的 *.ico 图标即可。
你就完成了!
如果按照上述操作后您的网站图标仍未显示,请重新刷新您的浏览器,或者直接清除网络历史记录。
Simply replace the favicon inside app/webroot with your own *.ico favicon.
And you're done !
If your favicon won't show after you done as above, Re-refresh your browser Or, simply clear web history.
这样
我就得到了 favicon。在这种情况下,不需要重命名默认的 favicon.ico
Given like this
In this way I got the favicon.In that case no need to rename the default favicon.ico
在您的 webroot 文件夹中更改 cake.icon.png 图像而不是您的图像。
在您的
view\layouts\default.ctp
中只需添加以下代码In your webroot folder change
cake.icon.png
image instead of your image.In your
view\layouts\default.ctp
just add this code那么您需要从 webroot 目录中删除默认的 favicon.ico 图标文件并放置您自己的图片。但请确保将该图片转换为图标格式并将其重命名为 favicon。我认为它应该有效,因为它对我有用。
Well you need to delete the default favicon.ico icon file from webroot directory and place your own picture. But make sure you convert that picture in icon format and rename it to favicon. I think it should work because it worked for me.
我必须将图标放入 /img/ 文件夹中 - 它只是不接受根文件夹中的图标。
I had to put the icon into the /img/ folder - it just wouldn't accept it in the root folder.
您可以使用它来显示网站图标。
you can use this for displaying favicon icon.
将您的 favicon 替换为 app/webroot/favicon.ico 并等待一段时间,因为它需要一些时间来反映在浏览器上。
Replace your favicon with app/webroot/favicon.ico and wait for sometime, as it require some time to reflect on browsers.
检查您的layout.ctp 文件以检查您的网站图标是否位于正确的位置。
把它放在你的标题中
使用的大小是16x16,png在.ico中重命名
Check your layout.ctp file to check if your favicon is located at the right place.
Put this in your header
The size to use is 16x16, png renamed in .ico
在布局中设置以下代码片段:
Html->meta('favicon.png','img/favicon.png',array('type' => 'icon')); ?>
// favicon.png 是 webroot/img 中的图像
set the following snippet in your layout:
Html->meta('favicon.png','img/favicon.png',array('type' => 'icon')); ?>
// favicon.png is your image in webroot/img