face from public folder in Bundle on the Symfony2?

I have a bundle calling MyBundle. In bundle on the public folder have css/fontes.css and have too the fontes folder.

In fontes folder have: sourcesanspro-regular-webfont.eot, sourcesanspro-regular-webfont.woff, sourcesanspro-regular-webfont.ttf, sourcesanspro-regular-webfont.svg, sourcesanspro-bold-webfont.eot, sourcesanspro-bold-webfont.woff, sourcesanspro-bold-webfont.ttf, sourcesanspro-bold-webfont.svg, sourcesanspro-light-webfont.eot, sourcesanspro-light-webfont.woff, sourcesanspro-light-webfont.ttf, sourcesanspro-light-webfont.svg.

Above the content fontes.css


    @font-face {
        font-family: 'source_sans_proregular';
        src: url('fontes/sourcesanspro-regular-webfont.eot');
        src: url('fontes/sourcesanspro-regular-webfont.eot?#iefix') format('embedded-opentype'),
             url('fontes/sourcesanspro-regular-webfont.woff') format('woff'),
             url('fontes/sourcesanspro-regular-webfont.ttf') format('truetype'),
             url('fontes/sourcesanspro-regular-webfont.svg#source_sans_proregular') format('svg');
        font-weight: normal;
        font-style: normal;

    }


    @font-face {
        font-family: 'source_sans_probold';
        src: url('fontes/sourcesanspro-bold-webfont.eot');
        src: url('fontes/sourcesanspro-bold-webfont.eot?#iefix') format('embedded-opentype'),
             url('fontes/sourcesanspro-bold-webfont.woff') format('woff'),
             url('fontes/sourcesanspro-bold-webfont.ttf') format('truetype'),
             url('fontes/sourcesanspro-bold-webfont.svg#source_sans_probold') format('svg');
        font-weight: normal;
        font-style: normal;

    }


    @font-face {
        font-family: 'source_sans_prolight';
        src: url('fontes/sourcesanspro-light-webfont.eot');
        src: url('fontes/sourcesanspro-light-webfont.eot?#iefix') format('embedded-opentype'),
             url('fontes/sourcesanspro-light-webfont.woff') format('woff'),
             url('fontes/sourcesanspro-light-webfont.ttf') format('truetype'),
             url('fontes/sourcesanspro-light-webfont.svg#source_sans_prolight') format('svg');
        font-weight: normal;
        font-style: normal;

    }

Could anyone help me loading the fonte.css and sources without using the command "asset:dump".


您可以将带有字体的文件夹符号链接到web文件夹。


You have your css in public/ folder of your bundle, which enables you to use assetic with the cssrewrite filter, to rewrite paths to the real path under web. See Fixing CSS Paths with the cssrewrite Filter

All other assets you can install with the symlink option under the web/ folder to make them accessible:

php app/console assets:install web --symlink --relative
链接地址: http://www.djcxy.com/p/60800.html

上一篇: 字体AweSome不适用于mvc3解决方案?

下一篇: 从Symfony2 Bundle中的公共文件夹面对?