twentysixx/x-ray 问题修复 & 功能扩展

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

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

twentysixx/x-ray

Composer 安装命令:

composer require twentysixx/x-ray

包简介

A visual X-ray for Craft CMS Twig templates — hover any front-end element to see which template or component rendered it, and the variables it received.

README 文档

README

A component X-ray for Craft CMS. Inspect your front end from inside the control panel: hover any element to see which Twig template rendered it, and the props (variables) it received — without leaving the CP.

X-Ray wraps your component templates with an interactive overlay. Open the X-Ray section in the control panel, point it at any page, and hover. You get the template path, a component hierarchy, per-template render counts, fully-typed props, rich rendering for Craft elements/Matrix blocks/assets, a Globals browser, and one-click "open in editor" deep links.

Requirements

  • Craft CMS 5.0.0 or later
  • PHP 8.2 or later
  • Admin access (X-Ray only ever activates for logged-in admins)

Installation

From the Plugin Store: search for "X-Ray" in your control panel under Plugins, then click Install.

With Composer:

composer require twentysixx/x-ray
php craft plugin/install x-ray

Usage

  1. Open X-Ray in the control-panel sidebar.
  2. Enter a front-end URL (or use the configured Start URL) and load it in the viewer.
  3. Click Inspect (or press Alt+I) and hover over the page.
  4. The sidebar shows the rendered template, its hierarchy, and the props passed in. Click a component to pin it.

X-Ray activates a page by appending ?xray=1 (configurable) and is only ever served to logged-in admins — your public front end is never affected.

Which templates get annotated

By default, X-Ray annotates partials whose filename starts with _ (e.g. _components/_card.twig). You can change the prefix, or switch to glob-based include/exclude patterns, in Settings. Templates that extends a layout or define {% block %}s are skipped automatically.

Settings

  • Start URL — the URL the viewer loads first (defaults to the site base URL).
  • Activation parameter — the query flag that turns X-Ray on (default xray).
  • Active mode — always, only in dev mode, or only in listed environments.
  • Template wrapping — filename prefix, plus include/exclude globs.
  • Appearance — accent colour, highlight style, tooltip label.
  • Behaviour — edit links, persistent selection, block external navigation.
  • Open in editor — pick a default editor, or a picker shown on each click; optional local base-path mapping for Docker/DDEV/VM setups.

All settings can also be set in config/x-ray.php for environment-specific overrides.

Privacy

X-Ray runs entirely within your own Craft install. It makes no external/network calls and is served only to authenticated admins.

Support

License

See LICENSE.md.

统计信息

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

GitHub 信息

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

其他信息

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

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固