Skip to content

Commit

Permalink
Merge pull request #7880 from cakephp/ADmad-patch-1
Browse files Browse the repository at this point in the history
Fix exception class
  • Loading branch information
dereuromark authored Jun 30, 2024
2 parents 3a1a9d8 + e00adb0 commit 1e248c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions en/tutorials-and-examples/cms/articles-controller.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ While this is a simple action, we've used some powerful CakePHP features. We
start our action off by using ``findBySlug()`` which is
a :ref:`Dynamic Finder <dynamic-finders>`. This method allows us to create a basic query that
finds articles by a given slug. We then use ``firstOrFail()`` to either fetch
the first record, or throw a ``NotFoundException``.
the first record, or throw a ``\Cake\Datasource\Exception\RecordNotFoundException``.

Our action takes a ``$slug`` parameter, but where does that parameter come from?
If a user requests ``/articles/view/first-post``, then the value 'first-post' is
Expand Down Expand Up @@ -359,7 +359,7 @@ now. Add the following action to your ``ArticlesController``::

This action first ensures that the user has tried to access an existing record.
If they haven't passed in an ``$slug`` parameter, or the article does not exist,
a ``NotFoundException`` will be thrown, and the CakePHP ErrorHandler will render
a ``RecordNotFoundException`` will be thrown, and the CakePHP ErrorHandler will render
the appropriate error page.

Next the action checks whether the request is either a POST or a PUT request. If
Expand Down

0 comments on commit 1e248c8

Please sign in to comment.