Skip to content

Commit

Permalink
docs: add sample code
Browse files Browse the repository at this point in the history
  • Loading branch information
kenjis committed Nov 25, 2023
1 parent 11afcc2 commit f55cb2e
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 8 deletions.
8 changes: 8 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,10 @@ the controller that should be used:

.. literalinclude:: restful/003.php

.. literalinclude:: restful/017.php

.. literalinclude:: restful/018.php

See also :ref:`controllers-namespace`.

Change the Placeholder Used
Expand Down Expand Up @@ -124,6 +128,10 @@ the controller that should be used:

.. literalinclude:: restful/011.php

.. literalinclude:: restful/019.php

.. literalinclude:: restful/020.php

See also :ref:`controllers-namespace`.

Change the Placeholder Used
Expand Down
4 changes: 0 additions & 4 deletions user_guide_src/source/incoming/restful/003.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@
$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');
4 changes: 0 additions & 4 deletions user_guide_src/source/incoming/restful/011.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,3 @@
$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');
5 changes: 5 additions & 0 deletions user_guide_src/source/incoming/restful/017.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?php

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

use App\Controllers\Gallery;

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

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

use App\Controllers\Gallery;

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

0 comments on commit f55cb2e

Please sign in to comment.