You are here

public function FaqController::orderPage in Frequently Asked Questions 8

Define the elements for the FAQ Settings page - order tab.

Parameters

$category: The category id of the FAQ page to reorder.

Return value

The form code, before being converted to HTML format.

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

File

src/Controller/FaqController.php, line 274

Class

FaqController
Controller routines for FAQ routes.

Namespace

Drupal\faq\Controller

Code

public function orderPage($tid = NULL) {
  $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['#attached']['library'][] = 'faq/faq-css';
  $build['faq_order'] = $this
    ->formBuilder()
    ->getForm('Drupal\\faq\\Form\\OrderForm');
  return $build;
}