Popups in Drupal 8? No problem!

hollywood.view_movie:
path: '/movies-list'
defaults:
_title: 'Movie List'
_controller: '\Drupal\hollywood\Controller\MovieList::overview'
requirements:
_permission: 'movies list'
$content['movie_list'] = array(
'#type' => 'table',
'#header' => $this->header(),
'#title' => $this->t('Movie List'),
'#rows' => $this->row(),
);
$content['overlay_link'] = array(
'#type' => 'link',
'#title' => $this->t('Add movie'),
'#url' => Url::fromRoute('node.add', ['node_type' => 'content_type_movie']),
'#attributes' => [
'class' => ['use-ajax'],
'data-dialog-type' => 'modal',
'data-dialog-options' => Json::encode([
'width' => 700,
]),
],
);
'#attributes' => [
'class' => ['use-ajax'],
'data-dialog-type' => 'modal',
'data-dialog-options' => Json::encode([
'width' => 700,
]),
],

Love to write code and discuss technology | If you explain others is simple words it means you know it very well

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store