rwoverdijk/assetmanager

Laminas的assetmanager模块。

3.0.0 2020-12-17 10:51 UTC

README

Wesley OverdijkMarco Pivetta编写

Build Status Latest Stable Version

⚠️ 已停止维护

偶尔可能会有PR合并,但最好使用分支。

缺乏足够信誉的PR将不会合并。

介绍

本模块旨在与LaminasSkeletonApplication的默认目录结构一起使用。它提供了通过简单配置从您的模块目录加载资源和静态文件的功能。这允许您无需将文件复制到public/目录,并且使用资源的方式与视图脚本非常相似,这可以被其他模块覆盖。简而言之,此模块允许您将资源与模块一起打包,并且可以立即使用。

安装

  1. 需要assetmanager
./composer.phar require rwoverdijk/assetmanager
# When asked for a version, type "2.*" when using Laminas. When using Zend Framework type "1.*"

使用方法

请参阅wiki以获取快速入门和更多信息。大部分,如果不是所有的话题,都在那里进行了深入探讨。

示例模块配置

<?php
return array(
    'asset_manager' => array(
        'resolver_configs' => array(
            'collections' => array(
                'js/d.js' => array(
                    'js/a.js',
                    'js/b.js',
                    'js/c.js',
                ),
            ),
            'paths' => array(
                __DIR__ . '/some/particular/directory',
            ),
            'map' => array(
                'specific-path.css' => __DIR__ . '/some/particular/file.css',
            ),
        ),
        'filters' => array(
            'js/d.js' => array(
                array(
                    // Note: You will need to require the classes used for the filters yourself.
                    'filter' => 'JSMin',
                ),
            ),
        ),
        'view_helper' => array(
            'cache'            => 'Application\Cache\Redis', // You will need to require the factory used for the cache yourself.
            'append_timestamp' => true,                      // optional, if false never append a query param
            'query_string'     => '_',                       // optional
        ),
        'caching' => array(
            'js/d.js' => array(
                'cache'     => 'Apc',
            ),
        ),
    ),
);

请注意,由于此模块将作为原样提供每个文件,包括PHP代码,所以请谨慎操作。

问题/支持

如果您在使用资产管理器时遇到困难,以下是一些可能有帮助的资源。

待办事项

最近任务列表已经大幅缩减。然而,还有一些事情需要完成。

  • 更新缓存