定制 roliod/codeigniter-asset-versioning 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

roliod/codeigniter-asset-versioning

Composer 安装命令:

composer require roliod/codeigniter-asset-versioning

包简介

This package can be used to force browser refresh of assets when cached in the users browser utilising an asset versioning technique.

README 文档

README

This package can be used to force browser refresh of assets when cached in the users browser utilising an asset versioning technique. The version number used is the assets last modified timestamp.

Installation

Installing Composer..

$ curl -sS https://getcomposer.org/installer | php
$ sudo mv composer.phar /usr/local/bin/composer

You are not obliged to move the composer.phar file to your /usr/local/bin, it is however considered easy to have an global installation.

Add the following to your require block in composer.json config

"roliod/codeigniter-asset-versioning": "^1.0"

If your new to composer and have no clue what I'm talking about

Just create a file named composer.json in your document root:

{
    "require": {
        "roliod/codeigniter-asset-versioning": "^1.0"
    }
}

Now let's install the package:

composer install

You can also install by using:

composer require roliod/codeigniter-asset-versioning

Lastly, run this command when the package has been successfully installed:

php vendor/roliod/codeigniter-asset-versioning/install.php

That's all !

Installation (Manual)

  • copy src/helpers/asset_helper.php to application/config
  • copy src/libraries/asset.php to application/libraries

Configuration (Autoload)

The autoload file is located at application/config/

  • add 'asset' to libraries
  • add 'asset' to helpers

$autoload['libraries'] = array('asset');

$autoload['helpers'] = array('asset');

Configuration (Config)

The config file is located at application/config/

  • add a 'base_url' config

$config['base_url'] = 'https://mywebsite.com'

Usage

  • CSS: <link href="<?php echo version_url('path/to/css/file') ?>" rel="stylesheet" type="text/css" />
  • JS: <script src="<?php echo version_url('path/to/js/file') ?>" type="text/javascript"></script>

统计信息

  • 总下载量: 91
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 1
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 1
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-06-02

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固