We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 7a2da33 commit 4282c7aCopy full SHA for 4282c7a
user_guide_src/source/tutorial/news_section/005.php
@@ -1,6 +1,6 @@
1
<h2><?= esc($title) ?></h2>
2
3
-<?php if (! empty($news) && is_array($news)): ?>
+<?php if ($news !== []): ?>
4
5
<?php foreach ($news as $news_item): ?>
6
user_guide_src/source/tutorial/news_section/006.php
@@ -15,7 +15,7 @@ public function show($slug = null)
15
16
$data['news'] = $model->getNews($slug);
17
18
- if (empty($data['news'])) {
+ if ($data['news'] === null) {
19
throw new PageNotFoundException('Cannot find the news item: ' . $slug);
20
}
21
0 commit comments