widgets\DetailView $template

$template public property

The template used to render a single attribute. If a string, the token {label} and {value} will be replaced with the label and the value of the corresponding attribute. If a callback (e.g. an anonymous function), the signature must be as follows:

function ($attribute, $index, $widget)

where $attribute refer to the specification of the attribute being rendered, $index is the zero-based index of the attribute in the $attributes array, and $widget refers to this widget instance.

Since Version 2.0.10, the tokens {captionOptions} and {contentOptions} are available, which will represent HTML attributes of HTML container elements for the label and value.

public string|callable $template = '<tr><th{captionOptions}>{label}</th><td{contentOptions}>{value}</td></tr>'
doc_Yii
2016-10-30 17:18:16
Comments
Leave a Comment

Please login to continue.