0

在我们使用的蛋糕中

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

将外部 js 文件添加到视图中我们如何使用锂做到这一点

4

1 回答 1

5

echo $this->html->script('jquery.js');返回一个<script />标签。如果文件名带有前缀"/",则路径将相对于应用程序的基本路径。否则,路径将相对于您的 JavaScript 路径,通常是webroot/js.

对于外部脚本$this->html->script('http://foo.com/bar.js');

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

于 2012-06-22T00:18:32.693 回答