Javascript files


    Bludit provides helpers to help developers to write less code.

    For the purpose of this tutorial we will use the following names:

    • Name of the theme box
    • Site URL
    • Theme path /bl-themes/box/
    • Javascript file path /bl-themes/box/main.js

    Let's add a Javascript file called main.js, which should be located in /bl-themes/box/main.js. You don't need to worry about the absolute path if you use the Theme:: helper.

        echo Theme::js('main.js');

    HTML output

    <script src=""></script>


    Here's a complete example of how to include two Javascript files in a theme.

    <!DOCTYPE html>
    <h1>This is a Heading</h1>
    <p>This is a paragraph.</p>
        echo Theme::js('main.js');
        echo Theme::js('buttons.js');