tollwerk/tw-base 问题修复 & 功能扩展

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

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

tollwerk/tw-base

Composer 安装命令:

composer require tollwerk/tw-base

包简介

Collection of building blocks and view helpers for TYPO3 projects made by tollwerk

README 文档

README

Collection of building blocks and viewhelpers for TYPO3 projects by tollwerk

Domain objects

Models

  • Custom Country model extending SJBR\StaticInfoTables\Domain\Model\Country (when the static_info_tables extension is installed)
  • UnsubmittableFormDefinition extending TYPO3\CMS\Form\Domain\Model\FormDefinition (Form Framework). Use for form definitions in combination with a custom hook to prevent advancing beyond the final form step (see class for hook example)

Repositories

  • Custom CountryRepository providing the method findByIntlPhoneNumber() to find all countries using a country code starting with particular digits. Extends SJBR\StaticInfoTables\Domain\Repository\CountryRepository when the static_info_tables extension is installed.

Traits

  • DebuggableRepositoryTrait — add this to a repository and use the debugQuery() method for debugging SQL queries.
  • StoragePidsIgnoringRepositoryTrait — add this to a repository as a quick and easy way to make it ignore the storage PIDs.

Link handlers

Services

  • Custom ImageService extending \TYPO3\CMS\Extbase\Service\ImageService adding format conversion capabilities
  • Image compression services (mozjpeg, SVGO)
  • Image converters (WebP)
  • Primitive LQIP service, creating SVGO previews of raster images
  • Text compression services (gzip, brotli)

These services don't work out of the box and require particular software to be available on the server:

  • For optimizing JPEG images using the mozjpeg encoder, install the Mozilla JPEG Encoder Project and create a mozjpeg alias to jpegtran.
  • For creating WebP image variants, install the WebP converter on the server and make sure the cwebp encoder tool is available as cwebp on the command line.
  • For creating AVIV image variants, install the AVIF converter on the server and make sure the encoder tool is available as avifenc on the command line.
  • For compressing SVG images on the fly, install the Node.js based SVGO tool and make sure it's available as svgo on the command line.
  • For creating SVG previews for images with Primitive, install the Go language and Primitive on your server and make sure primitive is available on the command line.
  • For creating gzipped versions of merged CSS and JavaScript files you need to have the GNU Gzip command line utility installed (standard on any Linux system), globally available as gzip binary.
  • For creating Brotli compressed versions of merged CSS and JavaScript files you need to have the Brotli command line utility installed, globally available as brotli binary.

Viewhelpers

  • cta viewhelper for rendering CallToAction <a> or <button> tags
  • debug viewhelper for better debugging of live environments
  • heading viewhelper for semantic document structuring
  • render viewhelper for rendering partials & sections with heading context awareness
  • image viewhelper for rendering compressed images
  • media viewhelper for responsive images
  • uniqid viewhelper
  • page.title viewhelper
  • structuredData.* viewhelpers
  • Viewhelpers for preparing / refining lists of HTML element attributes (empty / non-empty, data attributes, binary attributes)
  • language viewhelper to translate a 2-character ISO 639-1 language identifier into a readable label (internal languages only)
  • Form element viewhelper (returns a Form Framework element by its name)
  • form.page.elementsByIdentifier viewhelper (returns an array of all renderable elements of a form page by their identifier)
  • Link info viewhelper (returns detailed information about a link target)
  • SVG icon & icon sprite viewhelpers (returns detailed information about a link target)
  • format.age viewhelper for returning a human readable age string
  • format.leadingZeroes viewhelper for returning a formatted number string

Utilities

Title Providers

  • FlexPageTitleProvider for altering the default title of a page.
  • SeoPageTitleProvider for applying a dedicated page title for the <title> element only.

See the title provider documentation for details.

Validators

  • Unique object validator for testing whether a unique value is already taken (e.g. for use with the Form Framework)

TCA field evaluations

  • NumberEvaluation for numbers with any number of decimals positions. Removes any non-numeric character and converts , to .

Console Commands

  • cleanup:processedfiles for truncating the table of processed files and deleting the corresponding files from the file system
  • cleanup:convertedfiles for deleting the file variants generated by the image converters (WebP)
  • cleanup:nbsp for replacing non-breaking spaces with regular spaces in RTE fields
  • update:slugs for updating slugs for given tablenames and fieldnames.

Content Elements

  • Custom video content element with multiple sources, poster image and subtitles / captions

AjaxController

A ready-to-use controller and plugin for handling AJAX requests via ?type=4000. See AjaxController::dispatchAction() for documentation.

Miscellaneous

  • Image lazyloading with automatic SVG based preview images (like SQIP; requires particular software on the server)
  • Fluid Standalone template renderer
  • Email notification tool (HTML emails & plaintext)
  • Helper traits for repositories (for debugging SQL queries and for generally ignoring storage PIDs)

To-do

  • Test inline images in emails
  • Install simplexml for wyrihaximus/html-compress

tollwerk/tw-base 适用场景与选型建议

tollwerk/tw-base 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.24k 次下载、GitHub Stars 达 1, 最近一次更新时间为 2018 年 12 月 22 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「typo3」 「picture」 「viewhelper」 「fluid」 「extbase」 「MozJPEG」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 tollwerk/tw-base 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 tollwerk/tw-base 我们能提供哪些服务?
定制开发 / 二次开发

基于 tollwerk/tw-base 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: GPL-2.0
  • 更新时间: 2018-12-22