Let's say I have set the following field in my fields.yaml file:
my_field: label: My field type: partial path: ~/plugins/vendorname/pluginname/models/post/_mypartial.htm
Now is it possible to retrieve the model from my partial ? Something like
The model can be referenced in the partial as follow:
<?php $model ?> or <?php $formModel ?>
The field as:
<?php $field ?> or <?php $formField ?>
and the field value as:
<?php $value ?> or <?php $fieldValue ?>
Also, you can shorten your path definition with the "$" symbol which refers to the plugins folder by itself.
Use this code in your partial to see what's available:
<?php dump($this->vars); ?>
Great tips ! Thanks.
Its actually just $model (in form partials) and $record (in list partials)
1-6 of 6