You are here

public static function WundergroundWeatherSettingsForm::create in Wunderground weather 8

Instantiates a new instance of this class.

This is a factory method that returns a new instance of this class. The factory should pass any needed dependencies into the constructor of this class, but not the container itself. Every call to this method must return a new instance of this class; that is, it may not implement a singleton.

Parameters

\Symfony\Component\DependencyInjection\ContainerInterface $container: The service container this instance should use.

Overrides ConfigFormBase::create

File

src/Form/WundergroundWeatherSettingsForm.php, line 61
Contains \Drupal\wunderground_weather\Form\wunderground_weatherSettingsForm.

Class

WundergroundWeatherSettingsForm
Defines a form to configure module settings.

Namespace

Drupal\wunderground_weather\Form

Code

public static function create(ContainerInterface $container) {

  /** @var \Drupal\Core\Config\ConfigFactoryInterface $config_factory */
  $config_factory = $container
    ->get('config.factory');

  /** @var \Drupal\Core\Language\LanguageManager $language_manager */
  $language_manager = $container
    ->get('language_manager');

  /** @var \Drupal\Core\Utility\LinkGenerator $link_generator */
  $link_generator = $container
    ->get('link_generator');
  return new static($config_factory, $language_manager, $link_generator);
}