1 layout.api.php hook_layout_insert(Layout $layout)

Respond to initial creation of a layout.

This hook is invoked from Layout::save() after a layout has been saved to configuration.

Parameters

Layout $layout: The layout object that was saved.

Related topics

File

core/modules/layout/layout.api.php, line 314
Describe hooks provided by the Layout module.

Code

function hook_layout_insert(Layout $layout) {
  if ($layout->getPath() == 'my_path') {
    my_custom_function();
  }
}