Skip to content

Commit 6f9d3b8

Browse files
committed
Add enum templates
1 parent 76af3dd commit 6f9d3b8

File tree

3 files changed

+95
-0
lines changed

3 files changed

+95
-0
lines changed
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<article class="phpdocumentor-element-enum-case">
2+
{% embed 'components/content-header.html.twig' with { node: case, anchor: 'enumcase_' ~ case.name, anchor_link: link(case), header_tag: 'h3' } %}
3+
{% endembed %}
4+
{% include 'components/summary.html.twig' with { node: case } %}
5+
{% include 'components/deprecation.html.twig' with { node: case } %}
6+
{% include 'components/description.html.twig' with { node: case } %}
7+
{% include 'components/description.html.twig' with { node: case.var[0] } %}
8+
{% include 'components/tags.html.twig' with { node: case } %}
9+
</article>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{% set breadcrumbs = usesNamespaces ? breadcrumbs(node) : packages(node) %}
2+
{% set fqcn = breadcrumbs|map(breadcrumb => breadcrumb.name)|join('\\') ~ '\\' ~ node.name %}
3+
4+
{% embed 'components/content-header.html.twig' with {
5+
anchor: node.name,
6+
anchor_link: '#' ~ node.name,
7+
fqcn,
8+
add_edition: true,
9+
} %}
10+
{% block name %}
11+
{{ node.name }}
12+
{% endblock %}
13+
{% block subheader %}
14+
<div class="content-header__subheader">
15+
Enum
16+
{%- if node.backedType -%}
17+
: {{ node.backedType }}
18+
{% endif %}
19+
</div>
20+
{% endblock %}
21+
{% endembed %}
Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
{% extends 'base.html.twig' %}
2+
3+
{% block title %}{{ node.name }} | {{ parent() }}{% endblock %}
4+
{% block meta %}
5+
<meta name="description" content="{{ node.summary|escape }}" />
6+
{{ parent() }}
7+
{% endblock %}
8+
9+
{% block content %}
10+
{% include 'components/breadcrumbs.html.twig' %}
11+
{% include 'components/enum-title.html.twig' %}
12+
{% include 'components/element-header.html.twig' %}
13+
{{ include('components/enum-cases.html.twig') }}
14+
{{ include('components/methods.html.twig') }}
15+
{% endblock %}
16+
17+
{% block on_this_page %}
18+
{% set cases = cases(node) %}
19+
{% set methods = methods(node) %}
20+
21+
{% if cases is not empty or methods is not empty %}
22+
<label class="md-nav__title" for="__toc" title="{{ node.name }}">
23+
{{ node.name }}
24+
</label>
25+
{% endif %}
26+
27+
<ul class="md-nav__list">
28+
{% if cases is not empty %}
29+
<li class="md-nav__item level-1 with-children">
30+
<a href="{{ node|route("url")|raw }}#constants" title="Cases" class="md-nav__link">
31+
Cases
32+
</a>
33+
<nav class="md-nav">
34+
<ul class="md-nav__list">
35+
{% for case in cases %}
36+
<li class="md-nav__item level-2">
37+
<a href="{{ link(case) }}" title="{{ case.name }}" class="md-nav__link">
38+
{{ case.name }}
39+
</a>
40+
</li>
41+
{% endfor %}
42+
</ul>
43+
</nav>
44+
</li>
45+
{% endif %}
46+
{% if methods is not empty %}
47+
<li class="md-nav__item level-1 with-children">
48+
<a href="{{ node|route("url")|raw }}#methods" title="Methods" class="md-nav__link">
49+
Methods
50+
</a>
51+
<nav class="md-nav">
52+
<ul class="md-nav__list">
53+
{% for method in methods|sortByVisibility %}
54+
<li class="md-nav__item level-2">
55+
<a href="{{ link(method) }}" title="{{ method.name }}" class="md-nav__link">
56+
{{ method.name }}()
57+
</a>
58+
</li>
59+
{% endfor %}
60+
</ul>
61+
</nav>
62+
</li>
63+
{% endif %}
64+
</ul>
65+
{% endblock %}

0 commit comments

Comments
 (0)