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

Load the CSS/JS at specified moment #997

Open
IngwiePhoenix opened this issue Jan 16, 2015 · 2 comments
Open

Load the CSS/JS at specified moment #997

IngwiePhoenix opened this issue Jan 16, 2015 · 2 comments

Comments

@IngwiePhoenix
Copy link

Hey.

I have a bootstrap based app already together with a custom theme, and now I wanted to ad dBooster to it to have an easier access to widgets. But due to it's urge to always register on pre-load, I need to find a way to delay this load.

Currently I am using a custom renderScripts method which is called int he main viewfile. How can I now add YiiBooster to that chain of CSS/JS inserts, so it inserts itself after my resources?

Kind regards,
Ingwie

@amrbedair
Copy link
Contributor

'booster' => [
            'class' => 'booster.components.Booster', // assuming you extracted bootstrap under extensions
            'responsiveCss' => true,
            'coreCss' => true,
            'bootstrapCss' => false,
            'yiiCss' => true,
            'enableJS' => false,
            'enableBootboxJS' => true,
            'enableNotifierJS' => true,
            'enablePopover' => false,
            'enableTooltip' => false,
            //'debug' => true
        ],

you can enable and disable whatever you want ... this is just a sample from one of our projects ... using custom bootstrap theme

@IngwiePhoenix
Copy link
Author

I can, yes. But the issue is when it is being inserted. Even if I let a single JS file be enabled, it -will- be inserted before my scripts due to being called way earlier. I need a solution to disable the pre-loading and choose when exactly to load the CSS and JS stuff so I can load it from within my procedure. But looking into the code, I could not see anything. So appearently i now must make my own extension and re-load it before YiiBooster… Or is there still a way to get this behaviour, without me making a new component?

Good thing my code is open sourced:
Config: http://git.ingwie.me/ingwie/bird3/blob/master/protected/config/main.php#L67 http://git.ingwie.me/ingwie/bird3/blob/master/protected/config/main.php#L67
Script loader: http://git.ingwie.me/ingwie/bird3/blob/master/protected/components/Controller.php#L129 http://git.ingwie.me/ingwie/bird3/blob/master/protected/components/Controller.php#L129
When the script loader is called: http://git.ingwie.me/ingwie/bird3/blob/master/themes/dragonsinn/views/layouts/main.php#L9 http://git.ingwie.me/ingwie/bird3/blob/master/themes/dragonsinn/views/layouts/main.php#L9

Maybe this helps you understand what and why i am doing this.

Am 16.01.2015 um 13:40 schrieb Amr Bedair notifications@github.com:

'booster' => [
'class' => 'booster.components.Booster', // assuming you extracted bootstrap under extensions
'responsiveCss' => true,
'coreCss' => true,
'bootstrapCss' => false,
'yiiCss' => true,
'enableJS' => false,
'enableBootboxJS' => true,
'enableNotifierJS' => true,
'enablePopover' => false,
'enableTooltip' => false,
//'debug' => true
],
you can enable and disable whatever you want


Reply to this email directly or view it on GitHub #997 (comment).

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