You are here

class PreProcess in Field Formatter Template 8.2

Same name and namespace in other branches
  1. 8 src/Event/PreProcess.php \Drupal\fft\Event\PreProcess

Class PreProcess.

@package Drupal\fft\Event

Hierarchy

  • class \Drupal\fft\Event\PreProcess extends \Symfony\Component\EventDispatcher\Event

Expanded class hierarchy of PreProcess

1 file declares its use of PreProcess
fft.module in ./fft.module
Field formatter template.

File

src/Event/PreProcess.php, line 12

Namespace

Drupal\fft\Event
View source
class PreProcess extends Event {

  /**
   * Pre process event.
   */
  const EVENT = 'pre_process';

  /**
   * The variables.
   *
   * @var array
   */
  public $variables;

  /**
   * The template file.
   *
   * @var string
   */
  private $template;

  /**
   * PreProcess constructor.
   *
   * @param string $template
   *   The template file.
   * @param array $variables
   *   The variables.
   */
  public function __construct($template, array &$variables) {
    $this->variables =& $variables;
    $this->template = basename($template);
  }

  /**
   * Get template file.
   *
   * @return string
   */
  public function getTemplate() : string {
    return $this->template;
  }

}

Members

Namesort descending Modifiers Type Description Overrides
PreProcess::$template private property The template file.
PreProcess::$variables public property The variables.
PreProcess::EVENT constant Pre process event.
PreProcess::getTemplate public function Get template file.
PreProcess::__construct public function PreProcess constructor.