Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x

FactoryInterface.php

Namespace

Drupal\Component\Plugin\Factory

File

core/lib/Drupal/Component/Plugin/Factory/FactoryInterface.php

View source
<?php

namespace Drupal\Component\Plugin\Factory;


/**
 * Factory interface implemented by all plugin factories.
 */
interface FactoryInterface {
    
    /**
     * Creates a plugin instance based on the provided ID and configuration.
     *
     * @param string $plugin_id
     *   The ID of the plugin being instantiated.
     * @param array $configuration
     *   An array of configuration relevant to the plugin instance.
     *
     * @return object
     *   A fully configured plugin instance.
     *
     * @throws \Drupal\Component\Plugin\Exception\PluginException
     *   If the instance cannot be created, such as if the ID is invalid.
     */
    public function createInstance($plugin_id, array $configuration = []);

}

Interfaces

Title Deprecated Summary
FactoryInterface Factory interface implemented by all plugin factories.

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal