Programatik olarak Node oluşturma

Taskin
Taskin
10 dakika okuma süresi
<?php

// Node deposu getir.
$nodeStorage = \Drupal::service('entity.manager')->getStorage('node');
// Set node content.
$content = [
    'type' => 'article',
    'title' => 'title',
    'body' => [
        'value' => 'Lorem ipsum dolor sit amet...',
        'format' => 'basic_html'
    ],
    'uid' => $uid
];
// Node oluşturma.
$node = $nodeStorage->create($content);
// Node-u kayıt et.
$node->save();

Ofislerimiz

Drupart AR-GE

GOSB Teknopark Hi-Tech Bina 3.Kat
B3 Gebze - KOCAELİ

+90 262 678 8872 

[email protected]

Drupart Frankfurt

Media4People Bleichstr. 26 64283 Darmstadt
Deutschland

+49 (0) 6151 – 492 70 23 

[email protected]

Drupart Dublin

20 Harcourt Street, Dublin 2, D02 H364

+353 (87) 198 6950 

[email protected]