You are here

file.html.twig in Bamboo Twig 8.5

<div class="test-files">

  <!-- Extension Guesser -->
  <h2>Extension Guesser</h2>
  <hr>
  <div class="ext-guesser-pdf">
    {{ 'application/pdf'|bamboo_file_extension_guesser }}
  </div>
  <div class="ext-guesser-word-legacy">
    {{ 'application/msword'|bamboo_file_extension_guesser }}
  </div>
  <div class="ext-guesser-word">
    {{ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'|bamboo_file_extension_guesser }}
  </div>
  <div class="ext-guesser-png">
    {{ 'image/png'|bamboo_file_extension_guesser }}
  </div>

  <!-- System Url -->
  <h2>System Url</h2>
  <hr>
  <div class="url-module-file-relative">
    {{ file_url(bamboo_path_system('module', 'bamboo_twig_test') ~'/files/antistatique.jpg') }}
  </div>
  <div class="url-module-file-absolute">
    {{ bamboo_file_url_absolute(bamboo_path_system('module', 'bamboo_twig_test') ~'/files/antistatique.jpg') }}
  </div>
</div>

File

tests/modules/bamboo_twig_test/templates/file.html.twig
View source
  1. <div class="test-files">
  2. <!-- Extension Guesser -->
  3. <h2>Extension Guesser</h2>
  4. <hr>
  5. <div class="ext-guesser-pdf">
  6. {{ 'application/pdf'|bamboo_file_extension_guesser }}
  7. </div>
  8. <div class="ext-guesser-word-legacy">
  9. {{ 'application/msword'|bamboo_file_extension_guesser }}
  10. </div>
  11. <div class="ext-guesser-word">
  12. {{ 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'|bamboo_file_extension_guesser }}
  13. </div>
  14. <div class="ext-guesser-png">
  15. {{ 'image/png'|bamboo_file_extension_guesser }}
  16. </div>
  17. <!-- System Url -->
  18. <h2>System Url</h2>
  19. <hr>
  20. <div class="url-module-file-relative">
  21. {{ file_url(bamboo_path_system('module', 'bamboo_twig_test') ~'/files/antistatique.jpg') }}
  22. </div>
  23. <div class="url-module-file-absolute">
  24. {{ bamboo_file_url_absolute(bamboo_path_system('module', 'bamboo_twig_test') ~'/files/antistatique.jpg') }}
  25. </div>
  26. </div>