dantleech / dtlweb

New Homepage developed in parallel with tutorials
3 stars 0 forks source link

[ContactBundle] (#173) dynamic include CSS of bundles #42

Open dantleech opened 9 years ago

dantleech commented 9 years ago

Created by @michaelzangerle in https://github.com/sulu-cmf/SuluAdminBundle/issues/29 |

at the moment the stylesheet files of other bundles are included in the index.html.twig - better would be a dynamic way

dantleech commented 9 years ago

Created by: @dantleech (2014-07-24T06:42:58+00:00)

+1

dantleech commented 9 years ago

Created by: @dantleech (2014-07-25T07:50:34+00:00)

I wonder if we (could/should) handle this with Assetic? (I have never used it)

If not we could register the CSS / JS files in the Admin class, which would kinda make sense

class Admin
{
    public function __construct()
    {
        $tihs->registerJavascirpts(array(
            'js/myjslib.js',
            'js/myotherlib.js',
        ));

        $this->registerStylesheets(array(
            // ...
        ));

We could then dynamically include them in index.html.twig or dump some JSON with a command which could be read by grunt so that we could compile the assets for production. }

dantleech commented 9 years ago

Created by: @danrot (2014-07-26T07:01:34+00:00)

I would not include assetic unless it's unavoidable, since it makes the build process a bit more complicated (because we would have something like a 2-step build, which cannot be handled exclusively by grunt anymore).