You are here

AddressLookUpBlock.php in IP Geolocation Views & Maps 8

File

src/Plugin/Block/AddressLookUpBlock.php
View source
<?php

namespace Drupal\ip_geoloc\Plugin\Block;

use Drupal\Core\Block\BlockBase;

/**
 * Global IP address lookup.
 *
 * @Block(
 *   id = "address_lookup",
 *   admin_label = @Translation("Global IP address lookup"),
 *   category = @Translation("IP Geoloc"),
 * )
 */
class AddressLookUpBlock extends BlockBase {

  /**
   * {@inheritdoc}
   */
  public function build() {

    // Calling the set location form in block.
    $form = \Drupal::formBuilder()
      ->getForm('Drupal\\ip_geoloc\\Form\\GeoCodeAddressForm');
    return $form;
  }

  /**
   * {@inheritdoc}
   */
  public function getCacheMaxAge() {
    return 0;
  }

}

Classes

Namesort descending Description
AddressLookUpBlock Global IP address lookup.