Skip to content

Commit

Permalink
docs: fix incorrect sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Nov 25, 2023
1 parent e346a6f commit 11afcc2
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
4 changes: 4 additions & 0 deletions user_guide_src/source/incoming/restful.rst
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ the controller that should be used:

.. literalinclude:: restful/003.php

See also :ref:`controllers-namespace`.

Change the Placeholder Used
===========================

Expand Down Expand Up @@ -122,6 +124,8 @@ the controller that should be used:

.. literalinclude:: restful/011.php

See also :ref:`controllers-namespace`.

Change the Placeholder Used
===========================

Expand Down
7 changes: 5 additions & 2 deletions user_guide_src/source/incoming/restful/003.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

$routes->resource('photos', ['controller' => 'App\Gallery']);
$routes->resource('photos', ['controller' => 'Gallery']);
// Would create routes like:
$routes->get('photos', '\App\Controllers\Gallery::index');

$routes->resource('photos', ['controller' => '\App\Gallery']);
// Would create routes like:
$routes->get('photos', 'App\Gallery::index');
$routes->get('photos', '\App\Gallery::index');
7 changes: 5 additions & 2 deletions user_guide_src/source/incoming/restful/011.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?php

$routes->presenter('photos', ['controller' => 'App\Gallery']);
$routes->presenter('photos', ['controller' => 'Gallery']);
// Would create routes like:
$routes->get('photos', '\App\Controllers\Gallery::index');

$routes->presenter('photos', ['controller' => '\App\Gallery']);
// Would create routes like:
$routes->get('photos', 'App\Gallery::index');
$routes->get('photos', '\App\Gallery::index');
2 changes: 2 additions & 0 deletions user_guide_src/source/incoming/routing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,8 @@ You can supply multiple verbs that a route should match by passing them in as an
Specifying Route Handlers
=========================

.. _controllers-namespace:

Controller's Namespace
----------------------

Expand Down

0 comments on commit 11afcc2

Please sign in to comment.