Same filename and directory in other branches
  1. 6.0.x src/Form/AdvaggFormBase.php 1 commentaire
  2. 8.x-2.x src/Form/AdvaggFormBase.php 1 commentaire
  3. 8.x-3.x src/Form/AdvaggFormBase.php 1 commentaire
  4. 8.x-4.x src/Form/AdvaggFormBase.php 1 commentaire

Namespace

Drupal\advagg\Form

Fichier

src/Form/AdvaggFormBase.php

View source
<?php

namespace Drupal\advagg\Form;

use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormBuilderInterface;
use Symfony\Component\DependencyInjection\ContainerInterface;

/**
 * View AdvAgg information for this site.
 */
abstract class AdvaggFormBase extends ConfigFormBase {
    
    /**
     * {@inheritdoc}
     */
    public static function create(ContainerInterface $container) {
        
        /**
         * @var \Drupal\advagg\Form\AdvaggFormBase
         */
        $instance = parent::create($container);
        $instance->setRequestStack($container->get('request_stack'));
        return $instance;
    }
    
    /**
     * Checks if the form was submitted by AJAX.
     *
     * @return bool
     *   TRUE if the form was submitted via AJAX, otherwise FALSE.
     */
    protected function isAjax() {
        $request = $this->requestStack
            ->getCurrentRequest();
        if ($request->query
            ->has(FormBuilderInterface::AJAX_FORM_REQUEST)) {
            return TRUE;
        }
        return FALSE;
    }

}

Classes

Titre Deprecated Résumé
AdvaggFormBase View AdvAgg information for this site.