<legend id='WJgce'><style id='WJgce'><dir id='WJgce'><q id='WJgce'></q></dir></style></legend>

      <small id='WJgce'></small><noframes id='WJgce'>

        <bdo id='WJgce'></bdo><ul id='WJgce'></ul>
    1. <tfoot id='WJgce'></tfoot>
    2. <i id='WJgce'><tr id='WJgce'><dt id='WJgce'><q id='WJgce'><span id='WJgce'><b id='WJgce'><form id='WJgce'><ins id='WJgce'></ins><ul id='WJgce'></ul><sub id='WJgce'></sub></form><legend id='WJgce'></legend><bdo id='WJgce'><pre id='WJgce'><center id='WJgce'></center></pre></bdo></b><th id='WJgce'></th></span></q></dt></tr></i><div id='WJgce'><tfoot id='WJgce'></tfoot><dl id='WJgce'><fieldset id='WJgce'></fieldset></dl></div>

      1. Yii 的 AssetManager 有什么意义?

        What#39;s the point of Yii#39;s AssetManager?(Yii 的 AssetManager 有什么意义?)
            <tbody id='oQtLO'></tbody>

            <small id='oQtLO'></small><noframes id='oQtLO'>

            1. <legend id='oQtLO'><style id='oQtLO'><dir id='oQtLO'><q id='oQtLO'></q></dir></style></legend>

              <i id='oQtLO'><tr id='oQtLO'><dt id='oQtLO'><q id='oQtLO'><span id='oQtLO'><b id='oQtLO'><form id='oQtLO'><ins id='oQtLO'></ins><ul id='oQtLO'></ul><sub id='oQtLO'></sub></form><legend id='oQtLO'></legend><bdo id='oQtLO'><pre id='oQtLO'><center id='oQtLO'></center></pre></bdo></b><th id='oQtLO'></th></span></q></dt></tr></i><div id='oQtLO'><tfoot id='oQtLO'></tfoot><dl id='oQtLO'><fieldset id='oQtLO'></fieldset></dl></div>

                <bdo id='oQtLO'></bdo><ul id='oQtLO'></ul>
                <tfoot id='oQtLO'></tfoot>
                • 本文介绍了Yii 的 AssetManager 有什么意义?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我找不到很多关于 Yii 的 AssetManager 用于管理 JS 和 CSS 文件的信息.我的问题是使用 AssetManager 有什么意义?我不确定它为我的开发过程增加了什么价值,事实上,它似乎使我的代码复杂化......每次我更改脚本或 css 代码时,我都必须进入并删除我的资产文件夹以确保我有最新版本.

                  I can't find much information about Yii's AssetManager for the management of JS and CSS files. My question here is what is the point of using the AssetManager? I'm not sure what value it adds to my development process, in fact, it seems like it complicates my code... every time I change my scripts or css code, I have to go in and delete my assets folder to make sure I have the latest versions.

                  似乎将所有 Javascript 文件放在/webroot/js/下并使用标签加载文件而不是通过 AssetManager 的麻烦要简单得多.另外,Yii 的 registerCoreScript 函数总是将脚本标签放在 header 标签内,而不是像 YSlow 推荐的那样将它们放在代码底部,靠近结束体标签.

                  Seems it is much simpler to just put all Javascript files under /webroot/js/ and just use the tags to load the files instead of going through the trouble of AssetManager. Plus, Yii's registerCoreScript function always places script tags inside the header tag, instead of placing them at the bottom of the code, near the closing body tag, as recommended by YSlow.

                  我觉得我对 Yii 的 AssetManager 的理解肯定有差距.任何人都知道为什么使用 AssetManager 比在 PHP 代码中硬编码脚本标签更好?我有点糊涂了...

                  I think there must be a gap in my understanding of Yii's AssetManager. Anybody have any ideas why using the AssetManager is better than hard-coding the script tags inside the PHP code? I'm a bit confused...

                  谢谢!

                  推荐答案

                  我相信有人能比我自己回答得更好,但基本上是为了让您的源代码 JS 和 CSS 文件可以保留在您的受保护文件夹.

                  I'm sure someone can answer this better than myself, but basically it's so that your source JS and CSS files can remain in your Protected folder.

                  一方面,这更安全一点,但对我来说的主要好处是您可以使用资产发布系统压缩和缩小以及以其他方式处理您的资产,并且它更容易在 CDN 上托管您的 JS 和 CSS,因为它与您的代码库是分开的.

                  This is a little more secure for one thing, but the main benefit to me is that you can compress and minify and otherwise process your assets with the asset publishing system, and it makes it easier to host your JS and CSS on a CDN since it's separate from your codebase.

                  此外,这是来自qiang的官方回复(写 Yii 的人)关于这个.

                  Also, here's an official response from qiang (the guy who wrote Yii) about this.

                  这篇关于Yii 的 AssetManager 有什么意义?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

                  本站部分内容来源互联网,如果有图片或者内容侵犯了您的权益,请联系我们,我们会在确认后第一时间进行删除!

                  相关文档推荐

                  DeepL的翻译效果还是很强大的,如果我们要用php实现DeepL翻译调用,该怎么办呢?以下是代码示例,希望能够帮到需要的朋友。 在这里需要注意,这个DeepL的账户和api申请比较难,不支持中国大陆申请,需要拥有香港或者海外信用卡才行,没账号的话,目前某宝可以
                  PHP通过phpspreadsheet导入Excel日期,导入系统后,全部变为了4开头的几位数字,这是为什么呢?原因很简单,将Excel的时间设置问文本,我们就能看到该日期本来的数值,上图对应的数值为: 要怎么解决呢?进行数据转换就行,这里可以封装方法,或者用第三方的
                  mediatemple - can#39;t send email using codeigniter(mediatemple - 无法使用 codeigniter 发送电子邮件)
                  Laravel Gmail Configuration Error(Laravel Gmail 配置错误)
                  Problem with using PHPMailer for SMTP(将 PHPMailer 用于 SMTP 的问题)
                  Issue on how to setup SMTP using PHPMailer in GoDaddy server(关于如何在 GoDaddy 服务器中使用 PHPMailer 设置 SMTP 的问题)

                      <i id='aDplH'><tr id='aDplH'><dt id='aDplH'><q id='aDplH'><span id='aDplH'><b id='aDplH'><form id='aDplH'><ins id='aDplH'></ins><ul id='aDplH'></ul><sub id='aDplH'></sub></form><legend id='aDplH'></legend><bdo id='aDplH'><pre id='aDplH'><center id='aDplH'></center></pre></bdo></b><th id='aDplH'></th></span></q></dt></tr></i><div id='aDplH'><tfoot id='aDplH'></tfoot><dl id='aDplH'><fieldset id='aDplH'></fieldset></dl></div>

                        <tbody id='aDplH'></tbody>

                      • <bdo id='aDplH'></bdo><ul id='aDplH'></ul>

                        <small id='aDplH'></small><noframes id='aDplH'>

                      • <legend id='aDplH'><style id='aDplH'><dir id='aDplH'><q id='aDplH'></q></dir></style></legend><tfoot id='aDplH'></tfoot>