partial UI element renders a partial, the
path value can refer to a partial view file otherwise the field name is used as the partial name.
content: type: partial path: content_field
The following properties are supported.
|path||path to a partial view file or view template code, defaults to the field name.|
You may specify a fully qualified
path to access partials outside the controller scope.
content: type: partial path: $/acme/blog/models/comments/_content_field.htm
Inside the partial these variables are available.
$valueis the current field value, if found.
$modelis the model used for the field
$fieldis the configured class object
Here is an some example contents of the _content_field.htm file.
<?php if ($model->is_active): ?> <p><?= $field->label ?> is active</p> <?php endif ?>
# Using View Templates
You may pass a view template code as the
path to access view service templates inside the plugin. The following code would be found at the path plugins/acme/blog/views/formfields/content.php.
content: type: partial path: acme.blog::formfields.content
The path must contain the
:: characters to activate the view service.