mvccore/ext-view-helper-assets
Composer 安装命令:
composer require mvccore/ext-view-helper-assets
包简介
MvcCore - Extension - View - Helper - Assets - to group, render, minify and cache javascript and css files, to prepare all application assets for final application packing.
关键字:
README 文档
README
MvcCore View Helper extensin to group, render, minify and cache javascript and css files, to prepare all application assets for final application packing.
Installation
composer require mvccore/ext-view-helper-assets
Features
- grouping files together to deliver them in one response
- optional rendering PHP code inside group files
- optional completing assets url adresses targeting into index.php
packed result, where small data sources (icons, image maps...),
shoud be packed into, if you want to develop and build single
file application.
- Example:
<?php echo $this->AssetUrl('favicon.ico'); ?>
- Example:
- saving grouped files in application temp directory
'/Var/Tmp' - checking changed sources by file modification time or by file md5 imprint
- no source files checking in application compiled mode (packed into PHP package)
- optional CSS or JS minification by external library
mrclay/minify ^2.2.0 - optional downloading external js files into result group
Example
Base controller code:
namespace App\Controllers; class Base { public function PreDispatch () { parent::PreDispatch(); \MvcCore\Ext\Views\Helpers\Assets::SetGlobalOptions([ cssMinify => TRUE, cssJoin => TRUE, ]); $this->Css('head') ->AppendRendered('/app/root/rel/path/to/first.css') ->Append('/app/root/rel/path/to/second.css'); } }
Layout template code:
<html> <head> <!-- only one file will be generated and delivered: <link rel="stylesheet" href="/Var/Tmp/temp-file-name.css" /> --> <?php echo $this->Css('head')->Render(); ?> </head> <body>...</body> </html>
统计信息
- 总下载量: 822
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 2
- 点击次数: 0
- 依赖项目数: 13
- 推荐数: 0
其他信息
- 授权协议: BSD-3-Clause
- 更新时间: 2017-01-27