/redaxo-yform:yform-rest-apifrom redaxo-yform
Exposes YForm tables as JSON:API endpoints with token authentication, route registration, and per-method field whitelists. Use when building a frontend SPA backed by YForm data.
Ships in redaxo-yform. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
YForm includes a REST layer that exposes a YForm-backed dataset class as JSON:API endpoints. Authentication is token-based; routes are versioned by path; per-method field whitelists control what's readable / writable.
In your project addon's boot.php:
$route = new \rex_yform_rest_route([
'path' => '/v1/articles/',
'auth' => '\rex_yform_rest_auth_token::checkToken',
'type' => MyArticle::class,
'query' => MyArticle::query(),
'get' => [
MyArticle::class => [
'fields' => ['id', 'title', 'text', 'status'],
],
],
'post' => [
MyArticle::class => [
'fields' => ['title', 'text', 'status'],
],
],
'delete' => [
MyArticle::class => [
'fields' => ['id'],
],
],
]);
\rex_yform_rest::addRoute($route);
MyArticle must be a rex_yform_manager_dataset subclass registered with setModelClass(). The query value gives you a starting point — add where() clauses there to scope what the endpoint exposes.
All routes live under /rest/. With the example above, the endpoint URL is:
GET /rest/v1/articles/
POST /rest/v1/articles/
DELETE /rest/v1/articles/?filter[id]=5
| Parameter | Description | Example |
|---|---|---|
filter[field]=value | Filter records | ?filter[status]=1 |
include=relation | Include related dataset(s) | ?include=category |
per_page=N | Items per page | ?per_page=10 |
page=N | Page number | ?page=2 |
order[field]=dir | Sort | ?order[created]=desc |
Multiple filters are AND-combined: ?filter[status]=1&filter[clang_id]=1.
{
"data": {
"type": "MyArticle",
"attributes": {
"title": "Neuer Artikel",
"text": "Inhalt...",
"status": 1
}
}
}
The type value must match the class name registered in the route (MyArticle::class). Only fields listed in post.fields are accepted; everything else is ignored.
DELETE /rest/v1/articles/?filter[id]=5
Deletes match the same filter[...] semantics as GET. Be careful with broad filters — the API will happily delete every matching record.
Default is token-based via \rex_yform_rest_auth_token::checkToken. Manage tokens in the backend under YForm → REST → Tokens. Token scopes can be limited to specific routes.
Header:
Authorization: Bearer <token>
For public read-only endpoints, set 'auth' => null — but think hard before doing this; an open POST is an open data-injection target.
Global (applies to every YForm REST route):
\rex_yform_rest::setHeader('Access-Control-Allow-Origin', '*');
Per-route:
$route->setHeader('Access-Control-Allow-Origin', 'https://example.com');
For browser-based SPAs, add:
$route->setHeader('Access-Control-Allow-Methods', 'GET, POST, DELETE, OPTIONS');
$route->setHeader('Access-Control-Allow-Headers', 'Authorization, Content-Type');
get.fields, post.fields, delete.fields are independent. Practical pattern:
get.fields – everything safe to expose (excluding internal admin notes, soft-delete flags)post.fields – the user-editable subset (excluding id, created_at, status if those are server-controlled)delete.fields – usually just ['id'] for filter purposesAuthorization headerApache strips Authorization by default in some configurations. If valid tokens get rejected with Authorization failed, add to .htaccess:
RewriteCond %{HTTP:Authorization} .
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
boot.php that fires too late – register in boot.php directly (top level), not inside a callback that runs only on backend requests.setModelClass() – the route serializes plain rex_yform_manager_dataset instead of your subclass, and type mismatches break POST.'auth' => null for "just a quick test" and forgetting to restore it before deploying.post.fields that don't exist on the table – the field gets silently dropped from incoming POSTs.OPTIONS requests fail with no clear error.query start un-scoped – an open MyArticle::query() exposes every row in the table, including drafts and soft-deleted records. Always add baseline where() filters.What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub friendsofredaxo/claude-marketplace --plugin redaxo-yform6 skills in this plugin
/yform-datasetsORM-style read/write on YForm tables using rex_yform_manager_dataset and the query builder (rex_yform_manager_query). Covers model classes, all where/join/select/order/group methods, relations, pagination via rex_pager, CRUD, dataset-driven forms, and SQL debugging. Use when the user reads or writes to a YForm table from PHP, builds custom backend lists, joins related tables, paginates, or queries datasets in frontend templates./yform-email-templatesYForm email templates – placeholder syntax, sending mails from forms via tpl2email, sending mails programmatically from PHP, attachments, and using REX_YFORM_DATA placeholders. Use when the user creates or edits a YForm email template, configures tpl2email actions, sends YForm-template-based emails outside a form (e.g. cronjob, callback), or troubleshoots placeholder substitution./yform-fieldsYForm field types, validators, and actions – the building blocks for forms and tables. Covers all value/validate/action types with parameters, the choice / be_manager_relation / upload field configurations, custom field types, and the pipe syntax used in the Formbuilder. Use when picking field types, configuring validators, building custom field/validator classes, troubleshooting field rendering or save behavior, writing forms in pipe syntax, or when the user says "Feldtypen", "YForm-Felder", "Validierung", "Formular-Felder", "be_manager_relation", or "Formbuilder Pipe-Syntax"./yform-frontendBuilding public-facing YForm forms in REDAXO – contact forms, registrations, surveys, edit forms loading existing records, file uploads with email attachments, spam protection (honeypot/timestamp), CSRF tokens, and the full objparams cheat sheet. Use when the user creates or edits a frontend form, configures email actions, builds an edit-existing-record form, troubleshoots form rendering on the frontend, or asks how to set form_action / form_anchor / form_showformafterupdate./yform-tablesDefining and managing YForm tables in REDAXO – Table Manager backend UI, rex_yform_manager_table::ensure() in install.php, schema migrations, and tableset import/export. Use when the user works with YForm tables, edits install.php for a yform-using addon, defines field configurations, configures table-level options (pagination, search, history, export/import), or migrates table schemas between versions.Other plugins' skills for the same job