thinkphp-ui-restoration
Installation
SKILL.md
ThinkPHP UI Restoration
Use When
- The user wants a new ThinkPHP
.tplcomponent 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::assignstructure.
Rules
- Reuse existing project structure first:
view/@components,view/@pages,public/__base/css/common.css, and current class naming patterns. - Follow ThinkPHP template syntax and safe field access, such as
{$e.xxx|default=''}andisset(...)checks, to avoid undefined index errors. - When adding a component, also add the required CSS, mock fields, and controller/template wiring so it can render directly.
- Prefer updating existing
xqbj-components over creating a new pattern when the UI is only a variation of an existing block. - Put shared styles in
public/__base/css/common.css; only use page-level CSS when the style is truly page-specific. - If the component depends on list data, also update the matching mock data in
app/BaseController.phpor the relevant controller.