css脚本opencart与php文件

问题描述 投票:0回答:1

我尝试使用以下PHP脚本创建一个CSS文件:集成在OpenCart中以减少http请求。

... \目录\控制器\ COMMON \ css.php:

    class ControllerCommonCss extends Controller {
    public function index() { 

      $this->log->write('test');

      $cssFiles = array(
      "stylesheet.css",
      );

         $buffer = "";
         foreach ($cssFiles as $cssFile) {
         $buffer .= file_get_contents($cssFile);

         ...
      }
     }
    }

header.tpl:

<link rel="stylesheet" href="catalog/controller/common/css.php" type="text/css" media="screen">

error.log中的输出“test”不起作用。并且样式表不会加载到标题中。谁能告诉我什么是错的?

问候

php css opencart
1个回答
0
投票

您可以使用像NitroPack Cache这样的扩展程序,以及其他一些东西:https://docs.isenselabs.com/nitropack/minification

© www.soinside.com 2019 - 2024. All rights reserved.