You are here

trait AnchorTrait in Image Effects 8

Same name and namespace in other branches
  1. 8.3 src/Plugin/ImageEffect/AnchorTrait.php \Drupal\image_effects\Plugin\ImageEffect\AnchorTrait
  2. 8.2 src/Plugin/ImageEffect/AnchorTrait.php \Drupal\image_effects\Plugin\ImageEffect\AnchorTrait

Trait for anchor related functionalities.

Hierarchy

  • trait \Drupal\image_effects\Plugin\ImageEffect\AnchorTrait

File

src/Plugin/ImageEffect/AnchorTrait.php, line 8

Namespace

Drupal\image_effects\Plugin\ImageEffect
View source
trait AnchorTrait {

  /**
   * Returns an array of options for anchoring an image.
   *
   * @return array
   *   The array of anchor options.
   */
  protected function anchorOptions() {
    return [
      'left-top' => $this
        ->t('Top left'),
      'center-top' => $this
        ->t('Top center'),
      'right-top' => $this
        ->t('Top right'),
      'left-center' => $this
        ->t('Center left'),
      'center-center' => $this
        ->t('Center'),
      'right-center' => $this
        ->t('Center right'),
      'left-bottom' => $this
        ->t('Bottom left'),
      'center-bottom' => $this
        ->t('Bottom center'),
      'right-bottom' => $this
        ->t('Bottom right'),
    ];
  }

}

Members

Namesort descending Modifiers Type Description Overrides
AnchorTrait::anchorOptions protected function Returns an array of options for anchoring an image.