承接 arrounded/assets 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

arrounded/assets

最新稳定版本:2.0.0

Composer 安装命令:

composer require arrounded/assets

包简介

The description of the module

README 文档

README

Build Status Latest Stable Version Total Downloads Scrutinizer Quality Score Code Coverage

Install

Via Composer

$ composer require arrounded/assets

Usage

Assets pipeline

To use the assets pipeline create a config/assets.php file. In it you can define various collection of assets:

<?php return [
    'global' => [
        'css' => [
            'foo.css',
        ],
    ],
    'admin'  => [
        'css' => ['admin.css'],
        'js'  => ['admin.js'],
    ],
];

Add its service provider in config/app.php

Arrounded\Assets\ServiceProvider::class,

Then add the facade in the same file:

'Assets' => Arrounded\Assets\Facades\Assets::class,

Now in your views you can call this class to output a collection of assets:

{{ Assets.styles('global') }}
{{ Assets.scripts('admin') }}

AssetsReplacer

When going to production, you don't want to leave the Assets.styles and Assets.scripts calls as is as they will return the assets individually. The AssetsReplacer class will replace these calls with their actual values so usemin can read them and consume them.

$replacer = new AssetsReplacer($assetsHandler);
$replacer->replaceInFolder('resources/views');

JavascriptBridge

This is a class to pass data to the front-end. You can pass it as globals or namespaced. It's a static class so you can call it anywhere:

JavascriptBridge::add(['foo' => 'bar']);
JavascriptBridge::render(); // var foo = "bar";

JavascriptBridge::setNamespace('Arrounded');
JavascriptBridge::add(['foo' => 'bar']);
JavascriptBridge::render(); // var Arrounded = {}; Arrounded.foo = "bar";

It can also render classes implementing the Jsonable interface.

Testing

$ composer test

License

The MIT License (MIT). Please see License File for more information.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-06-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固