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

add support for head/footer locations #48

Open
leemason opened this issue Sep 29, 2013 · 0 comments
Open

add support for head/footer locations #48

leemason opened this issue Sep 29, 2013 · 0 comments

Comments

@leemason
Copy link

just a quick one which ive added to my app.

i needed to be able to set js for the head, and for the footer sections of the site, so this is how ive added it:

in the head section.

if(Casset::group_exists('js', 'footer')){
    Casset::set_js_option('footer', 'enabled', false);
}
echo Casset::render_js();

in the footer section

if(Casset::group_exists('js', 'footer')){
    Casset::set_js_option('footer', 'enabled', true);
}
echo Casset::render_js();

ive actually added this using the Event class for fuel, but it would work by just putting this in the view files too.

namepsaces still work fine, so files can still come from custom locations.

this works fine for me, but maybe some "global" footer/head groups could be created to prevent the need to check if the group exists first (without the checks the class throws an exception)

or event better add a var in the render function which allows us to set if the call in the head or footer, like:

echo Casset::render_js(false, true);

where true means we are in the footer.

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

1 participant