dantleech / dtlweb

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

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

Open dantleech opened 9 years ago

dantleech commented 9 years ago

Original issue: https://github.com/sulu-cmf/SuluAdminBundle/issues/29 Created by: @michaelzangerle 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

Comment by: %s (%s) +1

dantleech commented 9 years ago

Comment by: %s (%s) 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

Comment by: %s (%s) 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. }