eltharin/twigfilesgetter 问题修复 & 功能扩展

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

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

eltharin/twigfilesgetter

最新稳定版本:V1.1.3

Composer 安装命令:

composer require eltharin/twigfilesgetter

包简介

twigfilesgetter Bundle for symfony

README 文档

README

Latest Stable Version Total Downloads Latest Unstable Version License

Installation

  • Require the bundle with composer:
composer require eltharin/twigfilesgetter

What is TwigFilesGetter Bundle?

This bundle will help you to include css and js files once in your template.

Per example, when you make a Custom FormType who need a script, you can put in the buildView function the lines :

use Eltharin\TwigFilesGetterBundle\Service\FileManager;

...

public function buildView(FormView $view, FormInterface $form, array $options)
{
    FileManager::registerJsFile('/bundles/eltharinreloadablefield/js/reloader.js');
    ...
}

or in a twig template :

{% do addJs('/bundles/eltharinreloadablefield/js/reloader.js') %} 

or

{% do addCss('fichier.css') %}

or with a group : 

{% do addJs('fichier.js', 'group Name') %}

and in your template :

{{ get_required_js_files() }}

will write

<script src="/bundles/eltharinreloadablefield/js/scripts.js"/></script>

if you want have js in head and after the page you can specify a 'group'

public function buildView(FormView $view, FormInterface $form, array $options)
{
    FileManager::registerJsFile('/bundles/eltharinreloadablefield/js/file_in_head.js', 'head');
    FileManager::registerJsFile('/bundles/eltharinreloadablefield/js/file_bottom.js', 'bottom');
    ...
}

and in your template :

in head : 

{{ get_required_js_files('head') }}

and 

{{ get_required_js_files('bottom') }}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2022-08-14

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固