You are here

public static function LogintobogganLoginBlock::renderPlaceholderFormAction in LoginToboggan 8

Lazy_builder callback; renders a form action URL including destination.

Return value

array A renderable array representing the form action.

See also

\Drupal\Core\Form\FormBuilder::renderPlaceholderFormAction()

File

src/Plugin/Block/LogintobogganLoginBlock.php, line 181

Class

LogintobogganLoginBlock
Provides a 'LoginToboggan login' block.

Namespace

Drupal\logintoboggan\Plugin\Block

Code

public static function renderPlaceholderFormAction() {
  return [
    '#type' => 'markup',
    '#markup' => Url::fromRoute('<current>', [], [
      'query' => \Drupal::destination()
        ->getAsArray(),
      'external' => FALSE,
    ])
      ->toString(),
    '#cache' => [
      'contexts' => [
        'url.path',
        'url.query_args',
      ],
    ],
  ];
}