Skip to content

feat: improve View route output - #7646

Merged
kenjis merged 3 commits into
codeigniter4:4.4from
kenjis:feat-spark-routes-view-routes
Jul 7, 2023
Merged

feat: improve View route output#7646
kenjis merged 3 commits into
codeigniter4:4.4from
kenjis:feat-spark-routes-view-routes

Conversation

@kenjis

@kenjis kenjis commented Jul 3, 2023

Copy link
Copy Markdown
Member

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

@MGatner MGatner left a comment

Copy link
Copy Markdown
Member

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

kenjis commented Jul 4, 2023

Copy link
Copy Markdown
Member Author

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

kenjis commented Jul 4, 2023

Copy link
Copy Markdown
Member Author

@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

kenjis commented Jul 4, 2023

Copy link
Copy Markdown
Member Author

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

enhancement PRs that improve existing functionalities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants