lowentry/symfony-customizable-assets-install 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

lowentry/symfony-customizable-assets-install

Composer 安装命令:

composer require lowentry/symfony-customizable-assets-install

包简介

A Symfony bundle that allows you customize assets:install, can for example be used to add non-symfony asset bundles to /web/bundles.

README 文档

README

This bundle allows you to create your own symlinks/hardlinks/copies during assets:install.

This can be useful when using composer packages that were not specifically made for Symfony.

Installation / Usage

Execute:

composer require lowentry/symfony-customizable-assets-install

In your app/AppKernel.php, add the bundle:

$bundles = [
    ...
    new LowEntryCustomizableAssetsInstallBundle\LowEntryCustomizableAssetsInstallBundle()
];

In src/AppBundle/EventListener, create your event listener:

<?php
namespace AppBundle\EventListener;
class CustomizableAssetsInstallListener
{
    public function listen(\LowEntryCustomizableAssetsInstallBundle\Event\CustomizableAssetsInstallEvent $event)
    {
        // example:
        $event->makeLink($event->getVendorDir() . 'almasaeed2010/adminlte/', $event->getBundlesWebDir() . 'adminlte');
    }
}

In your app/config/services.yml, add the event listener:

    lowentry_customizable_assets_install_listener:
        class: AppBundle\EventListener\CustomizableAssetsInstallListener
        tags:
            - { name: kernel.event_listener, event: lowentry.customizable_assets_install, method: listen }

Done!

You should now be able to add custom links (symlinks/hardlinks/copies) in your event listener.

Notes

Note that this bundle was made for Symfony 3.1. It will likely work on other versions of Symfony as well, but that's not guaranteed.

Also note that you probably shouldn't use a slash ("/" or "\") right after $event->getSomeDir(), because if the getSomeDir() function returns an empty string, the slash would (on Mac and Linux) cause it to start from the root directory (example: "/something"), whereas without a slash it will be a relative path. The $event->getSomeDir() will always end with a slash so an additional slash is not needed.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: The
  • 更新时间: 2017-08-19

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固