You are here

public function FaqController::questionsSettings in Frequently Asked Questions 8

Renders the form for the FAQ Settings page - Questions tab.

Return value

The form code inside the $build array.

1 string reference to 'FaqController::questionsSettings'
faq.routing.yml in ./faq.routing.yml
faq.routing.yml

File

src/Controller/FaqController.php, line 309

Class

FaqController
Controller routines for FAQ routes.

Namespace

Drupal\faq\Controller

Code

public function questionsSettings() {
  $faq_settings = $this->config
    ->get('faq.settings');
  $build = array();
  $build['#attached']['library'][] = 'faq/faq-scripts';
  $build['#attached']['drupalSettings']['faqSettings']['hide_qa_accordion'] = $faq_settings
    ->get('hide_qa_accordion');
  $build['#attached']['drupalSettings']['faqSettings']['category_hide_qa_accordion'] = $faq_settings
    ->get('category_hide_qa_accordion');
  $build['faq_questions_settings_form'] = $this
    ->formBuilder()
    ->getForm('Drupal\\faq\\Form\\QuestionsForm');
  return $build;
}