Clarify that $title in FormField can accept ViewableData

When constructing a FormField, an IDE would previously tell you the `$title` needs to be string (or null). Let's make it more clear that a ViewableData instance (such as `HTMLValue::create($title)`) is also accepted. This should help people more quickly find a solution to put html in labels.
This commit is contained in:
JorisDebonnet 2019-09-26 02:39:39 +02:00 committed by GitHub
parent b15e416165
commit 349589b23b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -331,7 +331,7 @@ class FormField extends RequestHandler
* Creates a new field.
*
* @param string $name The internal field name, passed to forms.
* @param null|string $title The human-readable field label.
* @param null|string|SilverStripe\View\ViewableData $title The human-readable field label.
* @param mixed $value The value of the field.
*/
public function __construct($name, $title = null, $value = null)