Skip to content

Commit 5f6463f

Browse files
committed
Out: Fix missing string print in the default templates
Issue #53#closed
1 parent d75e401 commit 5f6463f

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/PHPDraft/Out/HTML/default.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,9 @@ use Enjoy\HttpStatusCode\Statuscodes;
130130
<a id="<?= str_replace('-', '/', $resource->get_href()); ?>"><?= $resource->title; ?></a>
131131
<small><?= $resource->href; ?></small>
132132
</h3>
133-
<p><?php $resource->description; ?></p>
133+
<?php if (!empty($resource->description)): ?>
134+
<p><?= $resource->description; ?></p>
135+
<?php endif; ?>
134136
<?php foreach ($resource->children as $transition): ?>
135137
<div
136138
class="card <?= $transition->get_method(); ?>">

src/PHPDraft/Out/HTML/material.phtml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,9 @@ use Enjoy\HttpStatusCode\Statuscodes;
7676
<a id="<?= str_replace('-', '/', $resource->get_href()); ?>"><?= $resource->title; ?></a>
7777
<small><?= $resource->href; ?></small>
7878
</h4>
79-
<p><?php $resource->description; ?></p>
79+
<?php if (!empty($resource->description)): ?>
80+
<p><?= $resource->description; ?></p>
81+
<?php endif; ?>
8082
<?php foreach ($resource->children as $transition): ?>
8183
<div class="demo-card-wide mdl-card mdl-shadow--2dp <?= $transition->get_method(); ?>">
8284
<div class="mdl-card__title">

tests/statics/full_test.apib

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,7 @@ Remove a Star from a Post.
209209
{}
210210

211211
## Users [/users{?limit}]
212+
Manipulate users.
212213

213214
### List Users [GET]
214215

@@ -285,4 +286,14 @@ User of the application
285286
+ multilined description - some dummy text
286287

287288
and it continue there
288-
and will end there
289+
and will end there
290+
291+
## Item
292+
+ Object (object)
293+
+ string_l2 (string)
294+
+ object_l2 (object)
295+
+ string_l3 (string)
296+
+ object_l3 (object)
297+
+ string1_l4 (string)
298+
+ string2_l4 (string)
299+
+ string3_l4 (string)

0 commit comments

Comments
 (0)