jdz/frontui 问题修复 & 功能扩展

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

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

jdz/frontui

Composer 安装命令:

composer require jdz/frontui

包简介

Framework-agnostic front UI helpers (asset versioning, lazy/zoom image tags) for simple Slim/Twig sites

README 文档

README

Framework-agnostic front UI helpers for simple Slim/Twig sites.

The front-end counterpart to jdz/adminUi: small, dependency-light Twig helpers shared by sites that ship the jizy-front.js / jizy-front.css bundle without the Callisto framework runtime — jupiter's own properties and the saturn sites migrated to a plain Slim front.

Contents

Namespace Class Role
JDZ\FrontUi\Twig FrontUiExtension Registers the asset() and jizyImg() Twig functions
JDZ\FrontUi\Html Image Builds a native-lazy, picviewer-ready <img> tag
JDZ\FrontUi\Html Helper Sanitises / normalises WYSIWYG content for front display (clean(), cleanDom()); cleanBlocks() / cleanLinks() hooks let a framework subclass inject its own transforms
JDZ\FrontUi\Html Attributes Parse / merge HTML tag attribute strings

Scope

Rendering helpers only. This is the framework-free replacement for the framework's JizyTwigExtension, which is coupled to the Callisto kernel (Config, Symfony Asset\Package, the GD/Imagine thumbnail pipeline).

  • asset(file, versionable = true) — root-absolute URL with an optional cache-busting ?v=… query.
  • jizyImg(src, alt, zoom = false)<img loading="lazy"> with width/height read from the source file; zoom adds the data-zoom attribute the bundled Modalizer.picviewer reads to open a gallery layer.

Thumbnail generation is intentionally out of scope — a simple front site serves the original asset with native lazy-loading.

Usage

use JDZ\FrontUi\Twig\FrontUiExtension;
use Slim\Views\Twig;

$twig = Twig::create(__DIR__ . '/templates');
$twig->addExtension(new FrontUiExtension(
    __DIR__ . '/public',   // web root, for image dimensions
    '160',                 // asset cache-busting version
));
<link rel="stylesheet" href="{{ asset('assets/css/theme.min.css') }}" />
<figure>{{ jizyImg('media/pages/photo.jpg', 'Légende', true) }}</figure>
use JDZ\FrontUi\Html\Helper;

$clean = Helper::clean($redactorContent);   // tag whitelist + FR typography
$tidy  = Helper::cleanDom($clean);          // strip inline styles + empty nodes

Requirements

PHP >= 8.2, twig/twig ^3.0.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2026-06-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固