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

  • <small id='0gKIw'></small><noframes id='0gKIw'>

      <bdo id='0gKIw'></bdo><ul id='0gKIw'></ul>
  • <tfoot id='0gKIw'></tfoot>

      1. <legend id='0gKIw'><style id='0gKIw'><dir id='0gKIw'><q id='0gKIw'></q></dir></style></legend>
      2. 防止在 Yii 中加载特定的 CSS 文件

        Preventing a specific CSS file from getting loaded in Yii(防止在 Yii 中加载特定的 CSS 文件)

      3. <small id='ZwFRj'></small><noframes id='ZwFRj'>

          <tbody id='ZwFRj'></tbody>

              <tfoot id='ZwFRj'></tfoot>
              <legend id='ZwFRj'><style id='ZwFRj'><dir id='ZwFRj'><q id='ZwFRj'></q></dir></style></legend>

              1. <i id='ZwFRj'><tr id='ZwFRj'><dt id='ZwFRj'><q id='ZwFRj'><span id='ZwFRj'><b id='ZwFRj'><form id='ZwFRj'><ins id='ZwFRj'></ins><ul id='ZwFRj'></ul><sub id='ZwFRj'></sub></form><legend id='ZwFRj'></legend><bdo id='ZwFRj'><pre id='ZwFRj'><center id='ZwFRj'></center></pre></bdo></b><th id='ZwFRj'></th></span></q></dt></tr></i><div id='ZwFRj'><tfoot id='ZwFRj'></tfoot><dl id='ZwFRj'><fieldset id='ZwFRj'></fieldset></dl></div>
                  <bdo id='ZwFRj'></bdo><ul id='ZwFRj'></ul>
                  本文介绍了防止在 Yii 中加载特定的 CSS 文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着跟版网的小编来一起学习吧!

                  问题描述

                  我在 Yii 中编码.

                  I am coding in Yii.

                  我已经在我的 main.php 布局文件中注册了 main.css 文件,如下所示:

                  I have registered the main.css file in my main.php layout file like so :

                  Yii::app()->clientScript->registerCssFile($this->assetsBase.'/css/main.css');
                  

                  现在这个脚本正在所有页面中注册.但是,假设我不希望在特定页面上注册该脚本.

                  Now this script is being registered in all the pages. However, say I don't want that script to be registered on a specific page.

                  我知道使用:

                  Yii::app()->clientScript->reset();
                  

                  将删除所有 CSS 文件,但我只想取消注册几个 CSS 文件.

                  would remove all the CSS files, however I want only few CSS files to be unregistered.

                  有办法吗?

                  推荐答案

                  您可以使用<特定视图中 CClientScript 的 code>scriptMap 属性,为您不想传递的特定脚本/css 文件的键传递 false被渲染.来自文档:

                  You can use the scriptMap property of CClientScript in your specific view, passing false for the particular script/css file's key that you don't want to be rendered. From the doc:

                  数组键是脚本文件名(不含目录部分),数组值是对应的 URL.如果数组值为false,则不会呈现相应的脚本文件.

                  The array keys are script file names (without directory part) and the array values are the corresponding URLs. If an array value is false, the corresponding script file will not be rendered.

                  例如,在 views/site/pages/about.php 中:

                  Yii::app()->clientScript->scriptMap = array(
                      'main.css' => false
                  );
                  

                  禁止包含使用 registerCssFile 注册的 main.css.

                  to disable the inclusion of main.css registered with registerCssFile.

                  scriptMap也可以用来控制js脚本文件的渲染.

                  The scriptMap can also be used for controlling the rendering of js script files.

                  这篇关于防止在 Yii 中加载特定的 CSS 文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持跟版网!

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

                  相关文档推荐

                  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 的问题)

                    <small id='4OA5j'></small><noframes id='4OA5j'>

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

                      <bdo id='4OA5j'></bdo><ul id='4OA5j'></ul>

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