Question

in cake we use

$this->html->script('jsfilenamewithdotjs');

to add an external js file to a view How'd we do that with lithium

Was it helpful?

Solution

echo $this->html->script('jquery.js'); returns a <script /> tag. If the filename is prefixed with "/", the path will be relative to the base path of your application. Otherwise, the path will be relative to your JavaScript path, usually webroot/js.

For an external script $this->html->script('http://foo.com/bar.js');

Docs: http://li3.me/docs/lithium/template/helper/Html::script()

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top