inspiredminds/contao-turbo-helper 问题修复 & 功能扩展

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

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

inspiredminds/contao-turbo-helper

最新稳定版本:1.3.6

Composer 安装命令:

composer require inspiredminds/contao-turbo-helper

包简介

This extension helps with the usage of Turbo in Contao applications.

README 文档

README

Contao Turbo Helper

This extension helps with the usage of Turbo in Contao applications.

  • It provides a Turbo Frame wrapper as content elements.
  • It forces the status code to 422 Unprocessable Entity when a Contao form does not validate.
  • It forces a JavaScript load of a form's target URL, in case it would redirect to a URL outside the current domain.

Streams

You can also create streams within your legacy Contao PHP templates:

<!-- templates/mod_newslist.html5 -->
<?php $this->startTurboStream(); ?>
  <turbo-stream action="append" target="mod-newslist-articles-<?= $this->id ?>">
    <template><?= implode('', $this->articles) ?></template>
  </turbo-stream>
  <turbo-stream action="update" target="mod-newslist-pagination-<?= $this->id ?>">
    <template><?= $this->pagination ?></template>
  </turbo-stream>
<?php $this->endTurboStream(); ?>

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

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

  <?php if (empty($this->articles)): ?>
    <p class="empty"><?= $this->empty ?></p>
  <?php else: ?>
    <div id="mod-newslist-articles-<?= $this->id ?>">
      <?= implode('', $this->articles) ?>
    </div>
    <div id="mod-newslist-pagination-<?= $this->id ?>">
      <?= $this->pagination ?>
    </div>
  <?php endif; ?>

<?php $this->endblock(); ?>

The server will then respond with these streams if there was a request with Accept: text/vnd.turbo-stream.html (e.g. through a link with data-turbo-stream).

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: LGPL-3.0-or-later
  • 更新时间: 2023-11-30