The script.json File

The script.json file contain about script tags for javascript source file. This file are required for creating a theme.

Location

The location of this file is inside a theme directory.

app/
└── view/
 └── [THEME_NAME]/
  ├──  ...
  ├──  script.json
  └──  ...

How It Works

The script.json file processed by SENE_Controller class constructor and outputed by getJsFooter().

Example Usage with JSON String

Here is the example codes for script.json file using json string.

[
  "<script src=\"{{base_url}}skin/front/js/nprogress.js\"></script>",
  "<script src=\"{{base_url}}skin/front/js/moment.min.js\"></script>",
  "<script src=\"{{base_url}}skin/front/js/moment-with-locales.min.js\"></script>"
]
Example Usage with JSON Object

Here is the example codes for script.json file using json object.

This method only supported from Seme Framework 4.0.2 above.

{
  "script":
  [
    {
      "src": "https://cdnjs.cloudflare.com/ajax/libs/nprogress/0.2.0/nprogress.min.js"
    },
    {
      "src": "{{base_url}}skin/v2/css/jquery.min.js"
    },
    {
      "src": "{{cdn_url}}assets/js/jquery.moneyFormat.min.js"
    }
  ]
}

The {{cdn_url}} and {{base_url}} Keyword

script.json support {{cdn_url}} and {{base_url}} keyword for replacing value from Seme Framework configuration.