[英]lithium add an external js file to view
in cake we use 在蛋糕上我们用
$this->html->script('jsfilenamewithdotjs'); $这个 - > HTML的“脚本( 'jsfilenamewithdotjs');
to add an external js file to a view How'd we do that with lithium 在视图中添加一个外部js文件我们如何用锂电池做到这一点
echo $this->html->script('jquery.js');
returns a <script />
tag. 返回
<script />
标记。 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
. 否则,该路径将相对于您的JavaScript路径,通常是
webroot/js
。
For an external script $this->html->script('http://foo.com/bar.js');
对于外部脚本
$this->html->script('http://foo.com/bar.js');
Docs: http://li3.me/docs/lithium/template/helper/Html::script() 文件: http : //li3.me/docs/lithium/template/helper/Html :: script()
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.