Fork me on GitHub


This returns the URL of a JavaScript file that's in the specified plugin's app/public/ directory. If a file extension isn't given, a .js is appended, but this automatic behavior can be bypassed by setting the add_extension option to false, as shown below.

// This will return a URL that looks like the following:
echo mvc_js_url('events-calendar-example', 'my_script');

// This will prevent the ".js" from being appended:
echo mvc_js_url('events-calendar-example', 'my_script', array('add_extension' => false));