Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
thiagogomesverissimo committed Jun 19, 2024
1 parent f2acd39 commit 516bbb5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion docs/tutoriais/drupal.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,15 @@ A partir dos **nids** pode-se carregar os objetos nodes:
$nodes = \Drupal\node\Entity\Node::loadMultiple($nids);
```

Iterando sob a os objetos nodes no twig:
```php
<ul>
{% for node in p %}
<li>{{ node.title.value }} - {{ node.field_autor.value }}</li>
{% endfor %}
</ul>
```

**Desafio: mostrar os títulos dos nodes no twig**

Criando um node do tipo page:
Expand All @@ -238,7 +247,7 @@ $node = Node::create([
$node->save();
```

Pode-se manipular um node já existente:
Pode-se manipular somente um node já existente:

```php
$nid = 1;
Expand Down

0 comments on commit 516bbb5

Please sign in to comment.