Skip to content

Yoyo Component Generator API

POST https://api.findutils.com/api/tools/yoyo-component-generator/execute

Generate Yoyo PHP component boilerplate: the PHP class (properties, props, query string, listeners, lifecycle hooks, actions, computed properties) and the matching PHP, Blade, or Twig template. Anonymous components return only the template.

Request body

application/json
  • name

    string optional

    Component name (converted to PascalCase). Default: "MyComponent". Default "MyComponent".

  • namespace

    string optional

    PHP namespace. Default: "App\Yoyo". Default "App\\Yoyo".

  • engine

    string optional

    Template engine. Default: "php". One of php · blade · twig. Default "php".

  • component_type

    string optional

    "dynamic" (class + template) or "anonymous" (template only). Default: "dynamic". One of dynamic · anonymous. Default "dynamic".

  • properties

    array optional

    Public properties: [{ name, type: string|int|float|bool|array, default_value? }].

  • use_props

    boolean optional

    Declare $props with every property name. Default: false. Default false.

  • use_query_string

    boolean optional

    Declare $queryString with every property name. Default: false. Default false.

  • actions

    array optional

    Action method names, e.g. ["increment", "decrement"].

  • computed_props

    array optional

    Computed property names, e.g. ["doubleCount"].

  • listeners

    array optional

    Event listeners: [{ event, handler }].

  • hooks

    array optional

    Lifecycle hooks to stub: any of "initialize", "mount", "rendering", "rendered".

Example arguments

Verified
{
  "name": "Counter",
  "properties": [
    {
      "name": "count",
      "type": "int",
      "default_value": "0"
    }
  ],
  "actions": [
    "increment"
  ],
  "computed_props": [
    "doubleCount"
  ]
}