← 返回
未分类 中文

ThinkPHP UI Restoration

Generate and restore ThinkPHP UI components using this project's existing conventions. Use when the user asks to create or restore `.tpl` components, adapt s...
Generate and restore ThinkPHP UI components using this project's existing conventions. Use when the user asks to create or restore `.tpl` components, adapt s...
cnoder-wgh
未分类 clawhub v0.1.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 358
下载
💾 0
安装
1
版本
#latest#thinkphp#ui

概述

ThinkPHP UI Restoration

Use When

  • The user wants a new ThinkPHP .tpl component or page section.
  • The user provides a screenshot, DOM, or reference UI to restore in this project.
  • The task also needs matching CSS, mock data, or controller View::assign structure.

Rules

  1. Reuse existing project structure first: view/@components, view/@pages, public/__base/css/common.css, and current class naming patterns.
  2. Follow ThinkPHP template syntax and safe field access, such as {$e.xxx|default=''} and isset(...) checks, to avoid undefined index errors.
  3. When adding a component, also add the required CSS, mock fields, and controller/template wiring so it can render directly.
  4. Prefer updating existing xqbj- components over creating a new pattern when the UI is only a variation of an existing block.
  5. Put shared styles in public/__base/css/common.css; only use page-level CSS when the style is truly page-specific.
  6. If the component depends on list data, also update the matching mock data in app/BaseController.php or the relevant controller.

Workflow

  1. Inspect nearby components and styles before creating new structure.
  2. Decide whether to reuse, extend, or add a new component.
  3. Implement the .tpl first, then matching CSS, then any mock/controller data needed.
  4. Keep output visually consistent with the existing project, including spacing, truncation, image handling, and mobile behavior.

Project Conventions

  • Components usually live in view/@components/ and are included from page templates.
  • Page templates usually live in view/@pages/.
  • Shared UI styles usually belong in public/__base/css/common.css.
  • Mock lists and fallback fields are commonly assigned from app/BaseController.php.
  • Use existing class prefixes such as xqbj-component-, xqbj-list-, and page-level wrappers already present nearby.

Delivery Checklist

  • .tpl structure matches nearby component style.
  • CSS is added in the correct file and follows existing naming.
  • Missing fields are guarded with default or conditional rendering.
  • Long text has truncation rules when needed.
  • Mobile layout is considered if the block appears in responsive pages.
  • Required mock data or controller View::assign data is updated.

Output Standard

  • Prefer minimal edits over introducing new abstractions.
  • Keep naming consistent with existing xqbj- / page-level patterns.
  • If a field may be absent, provide a default or conditional render path.
  • When restoring from a screenshot, match the existing project style rather than inventing a new design system.

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-07 14:43 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

frontend-performance-audit

cnoder-wgh
分析前端页面性能并输出结构化优化报告。适用于页面速度慢、lighthouse 指标差、core web vitals 不达标、首屏慢、交互卡顿、bundle 过大、阻塞渲染资源过多等场景。
★ 0 📥 549

Save All Resource

cnoder-wgh
打开可见浏览器手动浏览目标网站,实时监听并保存同域原始响应到本地桌面目录。
★ 0 📥 709
developer-tools

Document Diff

cnoder-wgh
比较两个文档或文件并生成结构化的差异报告。适用场景:用户要求比较文件、查找文档差异、生成差异报告等。
★ 0 📥 707