File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -70,7 +70,7 @@ Path: ``app/Views``::
7070 <ul>
7171 <?php foreach ($todo_list as $item): ?>
7272 <li><?= esc($item) ?></li>
73- <?php endforeach; ?>
73+ <?php endforeach ?>
7474 </ul>
7575
7676 </body>
Original file line number Diff line number Diff line change @@ -250,7 +250,7 @@ usefulness. It is easiest to demonstrate creating a new view by showing you the
250250 </li>
251251 <?php endif ?>
252252
253- <?php foreach ($pager->links() as $link) : ?>
253+ <?php foreach ($pager->links() as $link): ?>
254254 <li <?= $link['active'] ? 'class="active"' : '' ?>>
255255 <a href="<?= $link['uri'] ?>">
256256 <?= $link['title'] ?>
@@ -328,7 +328,7 @@ See following an example with these changes::
328328 </li>
329329 <?php endif ?>
330330
331- <?php foreach ($pager->links() as $link) : ?>
331+ <?php foreach ($pager->links() as $link): ?>
332332 <li <?= $link['active'] ? 'class="active"' : '' ?>>
333333 <a href="<?= $link['uri'] ?>">
334334 <?= $link['title'] ?>
Original file line number Diff line number Diff line change @@ -607,7 +607,7 @@ a new view at **/app/Views/_errors_list.php**::
607607
608608 <div class="alert alert-danger" role="alert">
609609 <ul>
610- <?php foreach ($errors as $error) : ?>
610+ <?php foreach ($errors as $error): ?>
611611 <li><?= esc($error) ?></li>
612612 <?php endforeach ?>
613613 </ul>
Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ a simplified format as well. Here is an example using ``foreach``::
2929
3030 <ul>
3131
32- <?php foreach ($todo as $item) : ?>
32+ <?php foreach ($todo as $item): ?>
3333
3434 <li><?= $item ?></li>
3535
@@ -46,15 +46,15 @@ Also notice that instead of using a semicolon after each structure
4646
4747Here is another example, using ``if ``/``elseif ``/``else ``. Notice the colons::
4848
49- <?php if ($username === 'sally') : ?>
49+ <?php if ($username === 'sally'): ?>
5050
5151 <h3>Hi Sally</h3>
5252
53- <?php elseif ($username === 'joe') : ?>
53+ <?php elseif ($username === 'joe'): ?>
5454
5555 <h3>Hi Joe</h3>
5656
57- <?php else : ?>
57+ <?php else: ?>
5858
5959 <h3>Hi unknown user</h3>
6060
Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ and add the next piece of code.
217217 </div>
218218 <p><a href="/news/<?= esc($news_item['slug'], 'url') ?>">View article</a></p>
219219
220- <?php endforeach; ?>
220+ <?php endforeach ?>
221221
222222 <?php else: ?>
223223
You can’t perform that action at this time.
0 commit comments