
Drupal
0
Вклад в тег
<?php
use Drupal\Core\DrupalKernel;
use Symfony\Component\HttpFoundation\Request;
use Drupal\node\Entity\Node;
define('DRUPAL_DIR', '/путь/до/корня');
$autoloader = require_once DRUPAL_DIR . '/autoload.php';
$kernel = new DrupalKernel('prod', $autoloader);
$request = Request::createFromGlobals();
chdir(DRUPAL_DIR);
$response = $kernel->handle($request);
$kernel->terminate($request, $response);
$nid = 1488;
$node = Node::load($nid);
echo $node->body->value;
$php show_node_content.php