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

feat: improve View route output #7646

Merged
merged 3 commits into from
Jul 7, 2023

Conversation

kenjis
Copy link
Member

@kenjis kenjis commented Jul 3, 2023

Needs #7653

Description

  • improve spark routes output for View routes
  • DebugBar shows View routes
$routes->view('about', 'pages/about');
+---------+-------------+------+------------------------------+----------------+---------------+
| Method  | Route       | Name | Handler                      | Before Filters | After Filters |
+---------+-------------+------+------------------------------+----------------+---------------+
| GET     | about       | »    | (View) pages/about           |                | toolbar       |
+---------+-------------+------+------------------------------+----------------+---------------+

Screenshot 2023-07-04 13 18 24

Checklist:

  • Securely signed commits
  • Component(s) with PHPDoc blocks, only if necessary or adds value
  • Unit testing, with >80% coverage
  • User guide updated
  • Conforms to style guide

@kenjis kenjis added enhancement PRs that improve existing functionalities 4.4 labels Jul 3, 2023
@kenjis kenjis marked this pull request as draft July 3, 2023 10:46
Copy link
Member

@MGatner MGatner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I be worried that this doesn't affect any tests?

EDIT: Oops, too quick! Draft now 👍

@kenjis
Copy link
Member Author

kenjis commented Jul 4, 2023

Please review #7653 first.

@kenjis kenjis force-pushed the feat-spark-routes-view-routes branch from 30750e3 to d2af631 Compare July 4, 2023 04:15
@kenjis
Copy link
Member Author

kenjis commented Jul 4, 2023

@lonnieezell The param $options is used for View::render() and RouteCollection:

public function view(string $from, string $view, ?array $options = null): RouteCollectionInterface
{
$to = static fn (...$data) => Services::renderer()
->setData(['segments' => $data], 'raw')
->render($view, $options);
$this->create('get', $from, $to, $options);
return $this;
}

Is it intentional?

@kenjis kenjis changed the title feat: improve spark routes output for View routes feat: improve output for View routes Jul 4, 2023
@kenjis kenjis changed the title feat: improve output for View routes feat: improve View route output Jul 4, 2023
@kenjis kenjis force-pushed the feat-spark-routes-view-routes branch from d2af631 to 9c9cad7 Compare July 4, 2023 22:56
@kenjis
Copy link
Member Author

kenjis commented Jul 4, 2023

Rebased and added docs.

@kenjis kenjis marked this pull request as ready for review July 4, 2023 23:11
@kenjis kenjis force-pushed the feat-spark-routes-view-routes branch from c12391f to 0aa5dbd Compare July 6, 2023 13:23
@kenjis kenjis merged commit 6c05c17 into codeigniter4:4.4 Jul 7, 2023
@kenjis kenjis deleted the feat-spark-routes-view-routes branch July 7, 2023 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.4 enhancement PRs that improve existing functionalities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants