承接 ameotoko/contao-encore-bridge 相关项目开发

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

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

ameotoko/contao-encore-bridge

Composer 安装命令:

composer require ameotoko/contao-encore-bridge

包简介

README 文档

README

This is an extension for Contao CMS which provides a wrapper for Webpack Encore bundle's encoreEntryLinkTags() and encoreEntryScriptTags() functions, allowing a developer to use those functions in .html5 templates as well.

Installation

NOTE: Webpack Encore Bundle requires output_path config to be set. If you do not yet have Webpack Encore Bundle installed, Contao-Encore Bridge will add it to your application automatically, so be sure to set output_path in your config.yml file before installation:

# config/config.yml
webpack_encore:
    output_path: '%kernel.project_dir%/public/build'

Then install Contao-Encore Bridge:

composer require ameotoko/contao-encore-bridge

Configuration

Configure your Webpack Encore as described in official docs:

Usage

Assuming you have configured your Webpack entrypoint like this:

// webpack.config.js
const Encore = require('@symfony/webpack-encore');

Encore
  .addEntry('app', './frontend/js/app.js')
;

you can now output all stylesheets and scripts for that entry in your .html5 templates, e.g. in fe_page.html5:

<!DOCTYPE html>
<html lang="<?= $this->language ?>"<?php if ($this->isRTL): ?> dir="rtl"<?php endif; ?>>
<head>
    ...
    <?= $this->encoreEntryLinkTags('app') ?>
</head>
<body>
    ...
    <?= $this->mootools ?>
    <?= $this->encoreEntryScriptTags('app') ?>
</body>
</html>

Or add them from any other template like so:

<?php $this->extend('ce_gallery'); ?>

<?php $this->block('content'); ?>
    <?php $this->parent(); ?>

    <?php $GLOBALS['TL_CSS'][] = $this->encoreEntryLinkTags('app'); ?>
    <?php $GLOBALS['TL_BODY'][] = $this->encoreEntryScriptTags('app'); ?>
<?php $this->endblock(); ?>

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2022-07-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固