Skip to content

Commit 55f26cd

Browse files
committed
docs: improve sample code
1 parent 3ccc5b0 commit 55f26cd

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

  • user_guide_src/source/general/errors
Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
<?php
22

3-
if (! $page = $pageModel->find($id)) {
4-
throw \CodeIgniter\Exceptions\PageNotFoundException::forPageNotFound();
3+
use CodeIgniter\Exceptions\PageNotFoundException;
4+
5+
$page = $pageModel->find($id);
6+
7+
if ($page === null) {
8+
throw PageNotFoundException::forPageNotFound();
59
}

0 commit comments

Comments
 (0)