page_layouts-1.0.1/src/LayoutsInterface.php

src/LayoutsInterface.php
<?php

declare(strict_types=1);

namespace Drupal\page_layouts;

use Drupal\Component\Plugin\PluginInspectionInterface;
use Drupal\Core\Entity\EntityInterface;
use Drupal\Core\Plugin\ContainerFactoryPluginInterface;

/**
 * Interface for layouts plugins.
 */
interface LayoutsInterface extends PluginInspectionInterface, ContainerFactoryPluginInterface {

  /**
   * Returns the translated plugin id.
   */
  public function id(): string;

  /**
   * Returns the translated plugin label.
   */
  public function label(): string;

  /**
   * Returns the translated plugin description.
   */
  public function description(): string;

  /**
   * Return the layout.
   *
   * @param Drupal\page_layouts\Entity\Layout $result
   *   The entity this plugin is associated with.
   *
   * @return array
   *   The theme template and variables.
   */
  public function getLayout(Layout $result);

  /**
   * Builds the associated form.
   *
   * @param Drupal\Core\Entity\EntityInterface $entity
   *   The entity this plugin is associated with.
   *
   * @return array
   *   \Drupal\page_layouts\Form\LayoutsFormInterface
   */
  public function buildForm(EntityInterface $entity);

}

Главная | Обратная связь

drupal hosting | друпал хостинг | it patrol .inc