Skip to content

Commit cb1243e

Browse files
committed
.phpdoc/template/trait.html.twig: Add missing template
1 parent adf8181 commit cb1243e

File tree

2 files changed

+112
-0
lines changed

2 files changed

+112
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
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 subheader %}
11+
<div class="content-header__subheader">Trait</div>
12+
13+
{% if node.usedTraits is not empty %}
14+
<div class="content-header__subheader">
15+
Uses
16+
{% for trait in node.usedTraits %}
17+
{{ trait|route('class:short') }}{% if not loop.last %}, {% endif %}
18+
{% endfor %}
19+
</div>
20+
{% endif %}
21+
{% endblock %}
22+
23+
{% endembed %}
Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
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/trait-title.html.twig' with { symfony_version: symfony_version } %}
12+
{% include('components/element-header.html.twig') %}
13+
{% include 'components/constants.html.twig' %}
14+
{% include 'components/properties.html.twig' %}
15+
{% include 'components/methods.html.twig' %}
16+
{% endblock %}
17+
18+
{% block on_this_page %}
19+
{% set constants = constants(node) %}
20+
{% set properties = properties(node) %}
21+
{% set methods = methods(node) %}
22+
23+
{% if constants is not empty or properties is not empty or methods is not empty %}
24+
<label class="md-nav__title" for="__toc" title="{{ node.name }}">
25+
{{ node.name }}
26+
</label>
27+
{% endif %}
28+
29+
<ul class="md-nav__list">
30+
{% if constants is not empty %}
31+
<li class="md-nav__item level-1 with-children">
32+
<a href="{{ node|route("url")|raw }}#constants" title="Constants" class="md-nav__link">
33+
Constants
34+
</a>
35+
<nav class="md-nav">
36+
<ul class="md-nav__list">
37+
{% for constant in constants|sortByVisibility %}
38+
<li class="md-nav__item level-2">
39+
<a href="{{ link(constant) }}" title="{{ constant.name }}" class="md-nav__link">
40+
{{ constant.name }}
41+
</a>
42+
</li>
43+
{% endfor %}
44+
</ul>
45+
</nav>
46+
</li>
47+
{% endif %}
48+
{% if properties is not empty %}
49+
<li class="md-nav__item level-1 with-children">
50+
<a href="{{ node|route("url")|raw }}#properties" title="Properties" class="md-nav__link">
51+
Properties
52+
</a>
53+
<nav class="md-nav">
54+
<ul class="md-nav__list">
55+
{% set treated_properties = [] %}
56+
{% for property in properties|sortByVisibility %}
57+
{% if property.__toString() not in treated_properties %}
58+
<li class="md-nav__item level-2">
59+
<a href="{{ link(property) }}" title="{{ property.name }}" class="md-nav__link">
60+
{{ property.name }}
61+
</a>
62+
</li>
63+
{% set treated_properties = treated_properties|merge([property.__toString()]) %}
64+
{% endif %}
65+
{% endfor %}
66+
</ul>
67+
</nav>
68+
</li>
69+
{% endif %}
70+
{% if methods is not empty %}
71+
<li class="md-nav__item level-1 with-children">
72+
<a href="{{ node|route("url")|raw }}#methods" title="Methods" class="md-nav__link">
73+
Methods
74+
</a>
75+
<nav class="md-nav">
76+
<ul class="md-nav__list">
77+
{% for method in methods|sortByVisibility %}
78+
<li class="md-nav__item level-2">
79+
<a href="{{ link(method) }}" title="{{ method.name }}" class="md-nav__link">
80+
{{ method.name }}()
81+
</a>
82+
</li>
83+
{% endfor %}
84+
</ul>
85+
</nav>
86+
</li>
87+
{% endif %}
88+
</ul>
89+
{% endblock %}

0 commit comments

Comments
 (0)