advaggFiles = $advagg_files; $this->advaggAggregates = $advagg_aggregates; $this->requestStack = $request_stack; } /** * {@inheritdoc} */ public static function create(ContainerInterface $container) { return new static( $container->get('config.factory'), $container->get('state.advagg.files'), $container->get('state.advagg.aggregates'), $container->get('request_stack') ); } /** * 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; } }