Home > Backend Development > PHP Tutorial > {insert_scripts files='common.js'} ,这里脚本的实际路径是什么??

{insert_scripts files='common.js'} ,这里脚本的实际路径是什么??

WBOY
Release: 2016-06-06 20:08:10
Original
1181 people have browsed it

在 ecshop 中的page_common.lbi中有这一样一句: {insert_scripts files='common.js'}

这边的 common.js 的实际路径是怎样的??

ecshop中的smarty模板的 insert_scripts 语法是怎样的?

回复内容:

在 ecshop 中的page_common.lbi中有这一样一句: {insert_scripts files='common.js'}

这边的 common.js 的实际路径是怎样的??

ecshop中的smarty模板的 insert_scripts 语法是怎样的?

应该是用的根目录的

源码里面搜索下
includes目录里面
lib_common.php 1390行
cls_template.php 1052行

<code><?php /**
 * 页面上调用的js文件
 *
 * @access  public
 * @param   string      $files
 * @return  void
 */
function smarty_insert_scripts($args)
{
    static $scripts = array();

    $arr = explode(',', str_replace(' ','',$args['files']));

    $str = '';
    foreach ($arr AS $val)
    {
        if (in_array($val, $scripts) == false)
        {
            $scripts[] = $val;
            if ($val{0} == '.')
            {
                $str .= '<script type="text/javascript" src="' . $val . '">';
            }
            else
            {
                $str .= '<script type="text/javascript" src="js/'%20.%20%24val%20.%20'"></script>';
            }
        }
    }

    return $str;
}
?></code>
Copy after login
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template