ui:prop
Defines a template argument (prop) for a component.
You must use this ViewHelper instead of the standard f:argument
ViewHelper to define props for a component.
It mirrors the API of f:argument
but adds some additional features like exposing the prop to the client hydration data or the context.
All props from a root component are automatically exposed the the context.
Example
<ui:prop name="variant" type="string" optional="{true}" default="primary" />
<ui:prop name="size" type="string" optional="{true}" default="medium" client="{true}" />
Arguments
Name | Type | Description | Required | Default |
---|---|---|---|---|
name |
string | name of the template argument | Yes | null |
type |
string | type of the template argument | Yes | null |
description |
string | description of the template argument | No | null |
optional |
boolean | true if the defined argument should be optional | No | false |
default |
mixed | default value for optional argument | No | null |
client |
boolean | Whether the property should be exposed to the client hydration data. See Hydration for more information. | No | false |
context |
boolean | Whether the property should be exposed to the components context. See Context for more information. | No | false |