Skip to content

Commit

Permalink
Merge pull request #2313 from MGatner/resource-modelname
Browse files Browse the repository at this point in the history
RESTful User Guide cleanup
  • Loading branch information
jim-parry authored Oct 8, 2019
2 parents c2407a1 + 8077de5 commit ad3b1dd
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions user_guide_src/source/incoming/restful.rst
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,13 @@ implement those methods that you want handled.::

<?php namespace App\Controllers;

use CodeIgniter\RESTful\ResourceController;
use CodeIgniter\RESTful\ResourceController;

class Photos extends ResourceController
{
{

public function __construct()
{
$this->modelName = 'App\Models\Photos';
}
protected $modelName = 'App\Models\Photos';
protected $format = 'json';

public function index()
{
Expand All @@ -133,7 +131,7 @@ for your resource, or process forms submitted from those views.

It is not needed, since the presentation can be handled with
a conventional controller - it is a convenience.
Its usage is similar to the resosurce routing::
Its usage is similar to the resource routing::

$routes->presenter('photos');

Expand Down Expand Up @@ -206,15 +204,12 @@ implement those methods that you want handled.::

<?php namespace App\Controllers;

use CodeIgniter\RESTful\ResourcePresenter;
use CodeIgniter\RESTful\ResourcePresenter;

class Photos extends ResourcePresenter
{
{

public function __construct()
{
$this->modelName = 'App\Models\Photos';
}
protected $modelName = 'App\Models\Photos';

public function index()
{
Expand Down

0 comments on commit ad3b1dd

Please sign in to comment.