Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The documentation for AbstractRestfulController is incomplete #129

Open
cbichis opened this issue Sep 5, 2022 · 0 comments
Open

The documentation for AbstractRestfulController is incomplete #129

cbichis opened this issue Sep 5, 2022 · 0 comments
Labels
Bug Something isn't working Documentation

Comments

@cbichis
Copy link

cbichis commented Sep 5, 2022

For AbstractRestfulController we should have more details, including a sample route.

By example there is an issue with a normal route config if is not nullified the default action. Without this the AbstractRestfulController tries to dispatch the indexAction (which can result in dispatching notFoundAction if indexAction is not defined)... I guess 'action' is defaulting to 'index' somehow.

'rest' => [
   'type' => Literal::class,
   'options' => [
      'route'    => '/rest',
      'defaults' => [
         'controller' => Controller\RestController::class,
         'action' => null
      ],
   ],
   'may_terminate' => true,
],

Of course, is still possible to use a Segment route:

'rest' => [
'type' => Segment::class,
'options' => [
	'route'    => '/rest[/:action]',
	'defaults' => [
		'controller' => Controller\RestController::class,
		'action'     => null,
	],
],
'may_terminate' => true,
],
@cbichis cbichis added the Bug Something isn't working label Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Documentation
Projects
None yet
Development

No branches or pull requests

2 participants