Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 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,12 @@ 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 @@ -122,6 +128,12 @@ 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
5 changes: 2 additions & 3 deletions user_guide_src/source/incoming/restful/003.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
<?php

$routes->resource('photos', ['controller' => 'App\Gallery']);

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

$routes->presenter('photos', ['controller' => 'App\Gallery']);

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