views:

23

answers:

1

http://stackoverflow.com/questions/2871655/proper-mime-type-for-fonts This matter is solved but i dont know how to do. help me I use cakePHP , I read RequestHanlder Component in bookcake but i dont ever use MIME.

A: 
header('Content-Type: font/opentype');

Put this anywhere in the controller before any output. This is standard PHP and doesn't have much to do with Cake. You can use RequestHandlerComponent::respondAs() to set this as well, which in the end does the same thing.

This only makes sense though if you're serving the font files using Cake/PHP at all. If they're just files in the /webroot folder that get served by your web server (Apache?), then neither PHP nor Cake have anything to do with it. In that case you need to instruct your web server to serve certain files with certain types. See here for an example.

deceze
@deceze: thanks for answer.
meotimdihia