2

Use Symfony2 assetic for managing assets other than images, js and css. Other assets such as swf, fonts etc or to be generic is there any generic option that can be used with assetic to use just about any type of file...file.xxx

For images it's :

{% image '@mybundlename/Resources/public/images/sample.png' %}
<img src="{{ assets_url }}" />
{% endimage %}

For stylesheets it's :

{% stylesheets ......

For javascripts it's :

{% javascripts..... }

So like wise what about other types of files.

3
  • 3
    where's the question? Commented Mar 6, 2013 at 7:55
  • right above your comment!! Commented Mar 6, 2013 at 11:58
  • xD @RobinRizvi Don is right, you have to be more specific Commented Mar 7, 2013 at 17:39

2 Answers 2

1

You can use twigs asset function

<img src="{{ asset('images/logo.png') }}" alt="Symfony!" />

<link href="{{ asset('css/blog.css') }}" rel="stylesheet" type="text/css" />

http://symfony.com/doc/2.3/book/templating.html#linking-to-assets

Sign up to request clarification or add additional context in comments.

Comments

0

I think, that you can try

{% image '@mybundlename/Resources/some/some.swf' %}
    <object type="application/x-shockwave-flash" data="{{ assets_url }}" /> 
{% endimage %}

But, if yours file located in the Resources/public/*, i.e. /ExampleBundle/Resources/public/flash/some.swf - use:

<object type="application/x-shockwave-flash" data="{{ asset('bundles/example/flash/some.swf') }}" />

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.