-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
feat: auto routes listing #5590
Conversation
591e05e
to
622d611
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is some great work @kenjis! I do wonder if the functional change could be confusing or break someone's CLI output. What about making this a separate command, and appending a warning note at the end of routes
like: "Auto-routing is enabled; run _____ to see additional active routes."
I would like to hear others' opinions too, I don't feel strongly either way.
@MGatner I think one command is better.
You can use grep for one controller.
|
e77083c
to
02c4d19
Compare
Added note in #5590 (comment) |
Rector reports an error. But on my local,
https://github.com/codeigniter4/CodeIgniter4/runs/4932368477?check_suite_focus=true |
Fixed the file.
|
8bd18f9
to
7fbeae2
Compare
CI4 still has |
<?php
namespace App\Controllers;
class Home extends BaseController
{
public function index()
{
return view('welcome_message');
}
public function _remap($method)
{
if ($method === 'abc') {
return $this->index();
}
return $this->default();
}
public function default()
{
return 'default';
}
} $ php spark routes
CodeIgniter v4.1.8 Command Line Tool - Server Time: 2022-01-25 23:24:33 UTC-06:00
+--------+----------------------------+------------------------------------------------+
| Method | Route | Handler |
+--------+----------------------------+------------------------------------------------+
| GET | / | \App\Controllers\Home::index |
| CLI | migrations/([^/]+)/([^/]+) | \CodeIgniter\Commands\MigrationsCommand::$1/$2 |
| CLI | migrations/([^/]+) | \CodeIgniter\Commands\MigrationsCommand::$1 |
| CLI | migrations | \CodeIgniter\Commands\MigrationsCommand::index |
| CLI | ci(.*) | \CodeIgniter\CLI\CommandRunner::index/$1 |
| auto | / | \App\Controllers\Home::_remap |
| auto | home[/...] | \App\Controllers\Home::_remap |
+--------+----------------------------+------------------------------------------------+ |
[ci skip]
b1ab1cd
to
6a2d8b1
Compare
Description
spark routes
Note:
If you have
Controllers\Home::index
, on macOS you can access it by:But this command shows only
home/index[/...]
.Checklist: