Skip to content

Commit 6f9927f

Browse files
committed
Add enum to left side menu
1 parent 8384fe0 commit 6f9927f

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

tools/php_api_ref/.phpdoc/template/components/menu-entry.html.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% set is_nested = entry.children.count or entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined %}
1+
{% set is_nested = entry.children.count or entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined or entry.enums[0] is defined %}
22
{% set url = entry|route("url")|raw %}
33
{% set type = type|default('') %}
44

tools/php_api_ref/.phpdoc/template/components/menu.html.twig

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,10 @@
3535
</ul>
3636
{% endif %}
3737

38-
{% if entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined %}
38+
{% if entry.interfaces[0] is defined or entry.classes[0] is defined or entry.traits[0] is defined or entry.enums[0] is defined %}
3939
{% if depth > 1 %}
4040
<label class="md-nav__list-title">
41-
Interfaces, classes, and traits
41+
Interfaces, classes, traits, and enums
4242
</label>
4343
{% endif %}
4444
<ul class="md-nav__list">
@@ -78,6 +78,19 @@
7878
icon: 'file.svg',
7979
} %}
8080

81+
{% set index = index + 1 %}
82+
{% endfor %}
83+
{% endif %}
84+
{% if entry.enums[0] is defined %}
85+
{% for element in entry.enums|sort_asc %}
86+
{% include 'components/menu-entry.html.twig' with {
87+
title: element.name|shortFQSEN,
88+
nav_id: nav_id ~ '-' ~ index,
89+
entry: element,
90+
expanded: false,
91+
icon: 'file.svg',
92+
} %}
93+
8194
{% set index = index + 1 %}
8295
{% endfor %}
8396
{% endif %}

0 commit comments

Comments
 (0)