Tos Web Developer provides insights, tutorials, and advice around topics including content strategy, design, Drupal Development, Drupal Custom Module Development, Drupal 8 Custom themes, PHP, Server, Twig, and more



In custom module, Node can be loaded in the following way :

 use \Drupal\node\Entity\Node; //Don't forget to add a use statement in beginning of file.  
 $node = \Drupal\node\Entity\Node::load($nid); //$nid is Node ID.  

No comments:

Post a Comment

| Designed And Blog Post by www.toswebdeveloper.com