ThinkPHP UI Restoration
by @cnoder-wgh
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...
clawhub install thinkphp-ui-restorationπ About This Skill
name: thinkphp-ui-restoration description: Generate and restore ThinkPHP UI components using this project's existing conventions. Use when the user asks to create or restore
.tpl components, adapt screenshots/designs into existing ThinkPHP pages, or add matching CSS/mock data/controller bindings for this codebase.
ThinkPHP UI Restoration
Use When
.tpl component or page section.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
view/@components/ and are included from page templates.view/@pages/.public/__base/css/common.css.app/BaseController.php.xqbj-component-, xqbj-list-, and page-level wrappers already present nearby.Delivery Checklist
.tpl structure matches nearby component style.default or conditional rendering.View::assign data is updated.Output Standard
xqbj- / page-level patterns.π Constraints
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.