Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with Assetic Twig function "javascripts" #722

Closed
spicyroland opened this issue Mar 9, 2015 · 3 comments
Closed

Issue with Assetic Twig function "javascripts" #722

spicyroland opened this issue Mar 9, 2015 · 3 comments

Comments

@spicyroland
Copy link

I'm using bolt.cm based on Silex.
Added this..

"symfony/assetic-bundle": "~2.6",

..to my composer.json.
I have this inside my index.twig:

{% block additionalscripts %}
    {% javascripts 'ckeditor.js' output = '/files/js/ckeditor.js' %}
        <script src="{{ asset_url }}"></script>
    {% endjavascripts %}
{% endblock %}

Inside Bolt\Application.php I pass a new Instance of AsseticExtension to Twig using this:

// Add the Bolt Twig Extension.
  $this['twig'] = $this->share(
            $this->extend(
                'twig',
                function (\Twig_Environment $twig, $app) {
                    $twig->addExtension(new TwigExtension($app));
                    $themebase = $app['resources']->getPath('theme');

                    $am = new AssetManager();
                    $fm = new FilterManager();
                    $appbase = $app['resources']->getPath('app');
                    $am->set('ckeditor', new FileAsset($appbase.'/view/lib/ckeditor/ckeditor.js'));
                    $factory = new AssetFactory($themebase);
                    $factory->setAssetManager($am);
                    $factory->setFilterManager($fm);
                    $factory->setDebug(true);
                    $twig->addExtension(new AsseticExtension($factory));
                    return $twig;
                }
            )
        );

And when I run it i get this weird file inside my head-tag:

<script src="**/files/js/ckeditor_ckeditor_1.js**"></script>

File doesn't exist nor does it get created!!
What I'm I doing wrong or is it some kind of an issue?

@spicyroland
Copy link
Author

..sorry - weird file got cut off.
<script src="**/files/js/ckeditor_ckeditor_1.js**"></script>

@stof
Copy link
Collaborator

stof commented Mar 9, 2015

This is exactly the same than https://github.com/symfony/AsseticBundle/issues/352, right ?

@stof
Copy link
Collaborator

stof commented Sep 1, 2015

Closing as there was no feedback (neither here or in AsseticBundle)

@stof stof closed this as completed Sep 1, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants