Skip to content

Instantly share code, notes, and snippets.

@oscarnevarezleal
Created August 21, 2015 08:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oscarnevarezleal/f8e5a9ecf6b75d61cc97 to your computer and use it in GitHub Desktop.
Save oscarnevarezleal/f8e5a9ecf6b75d61cc97 to your computer and use it in GitHub Desktop.
$homeNode = Node::create(array(
'type' => 'node',
'title' => 'Home page',
'langcode' => 'en',
'uid' => '1',
'status' => 1,
'promoted' => 1,
'field_fields' => array(),
));
$homeNode->save();
}
$page_front = '/node/' . $homeNode->id();
\Drupal::service('config.factory')
->getEditable('system.site')
->set('page.front', $page_front)
->save();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment