Skip to content

add support for head/footer locations #48

@leemason

Description

@leemason

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions