FormulaLoader.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /*
  3. * This file is part of the Symfony framework.
  4. *
  5. * (c) Fabien Potencier <fabien.potencier@symfony-project.com>
  6. *
  7. * This source file is subject to the MIT license that is bundled
  8. * with this source code in the file LICENSE.
  9. */
  10. namespace Symfony\Bundle\AsseticBundle\Templating;
  11. use Assetic\Factory\Loader\FormulaLoaderInterface;
  12. use Assetic\Factory\Resource\ResourceInterface;
  13. /**
  14. * Loads formulae from PHP templates.
  15. *
  16. * @author Kris Wallsmith <kris.wallsmith@symfony-project.com>
  17. */
  18. class FormulaLoader implements FormulaLoaderInterface
  19. {
  20. public function load(ResourceInterface $resource)
  21. {
  22. $tokens = token_get_all($resource->getContent());
  23. /**
  24. * @todo Find and extract asset formulae from calls to the following:
  25. *
  26. * * $view['assetic']->assets(...)
  27. * * $view['assetic']->javascripts(...)
  28. * * $view['assetic']->stylesheets(...)
  29. * * $view->get('assetic')->assets(...)
  30. * * $view->get('assetic')->javascripts(...)
  31. * * $view->get('assetic')->stylesheets(...)
  32. *
  33. * The loader will also need to be aware of debug mode and the default
  34. * output strings associated with each method.
  35. */
  36. return array();
  37. }
  38. }