Module Development

PHP Class Method Arguments for Drupal 8, 9

Sprout Video

In this PHP tutorial, you'll get more practice working with methods. Along with adding some functionality to a method using PHP's sprintf() function to format a string, you'll use the $this pseudo-variable, and learn how to add and use arguments with methods.

Additional resources

sprintf (PHP Manual)