Skip to content

[FrameworkBundle][Routing] Show welcome message if no routes are configured #24403

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

Merged
merged 1 commit into from
Oct 2, 2017

Conversation

yceruto
Copy link
Member

@yceruto yceruto commented Oct 2, 2017

Q A
Branch? 3.4 (it would be good, else 4.1)
Bug fix? no
New feature? yes
BC breaks? no
Deprecations? no
Tests pass? yes
Fixed tickets symfony/flex#20
License MIT
Doc PR -

Another attempt to improve the first time experience with a different technical approach this time.

Just after a fresh "SymfonyFlex" installation:

$ composer create-project symfony/skeleton flex
$ cd flex
$ make serve

welcome

When the first route is added, this message is no longer displayed (same if debug mode is disabled).

ping @javiereguiluz, @sstok

@yceruto yceruto changed the title [FrameworkBundle][Routing] Show welcome page if no routes are configured [FrameworkBundle][Routing] Show welcome message if no routes are configured Oct 2, 2017
@yceruto
Copy link
Member Author

yceruto commented Oct 2, 2017

Failures:

  • Travis failure is normal over master branch.
  • About fabbot I'm not sure if it should be fixed, because similar fixtures have the same extra line.

$code .= " if ('/' === \$pathinfo) {\n";
$code .= " throw new Symfony\Component\Routing\Exception\NoConfigurationException();\n";
$code .= " }\n";
}
Copy link
Member

Choose a reason for hiding this comment

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

I like this approach, makes a lot of sense to me.

Copy link
Contributor

Choose a reason for hiding this comment

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

👏 ingenious indeed.

@yceruto
Copy link
Member Author

yceruto commented Oct 2, 2017

Status: Needs Review

@yceruto
Copy link
Member Author

yceruto commented Oct 2, 2017

Now the solution looks better to me, so the response is setting on kernel.request event.

Copy link
Member

@nicolas-grekas nicolas-grekas left a comment

Choose a reason for hiding this comment

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

Nice :)

@yceruto yceruto force-pushed the welcome branch 3 times, most recently from a2670cc to d83b578 Compare October 2, 2017 21:49
@fabpot
Copy link
Member

fabpot commented Oct 2, 2017

@yceruto Can you also patch the other URL matchers like UrlMatcher for instance. Just for consistency.

@yceruto
Copy link
Member Author

yceruto commented Oct 2, 2017

@fabpot indeed, thanks.

@fabpot
Copy link
Member

fabpot commented Oct 2, 2017

@yceruto I think we need support for the new exception in Symfony\Component\Routing\Matcher\UrlMatcher as well.

@yceruto
Copy link
Member Author

yceruto commented Oct 2, 2017

@fabpot done.

@fabpot
Copy link
Member

fabpot commented Oct 2, 2017

Thank you @yceruto.

@fabpot fabpot merged commit e097ab3 into symfony:3.4 Oct 2, 2017
fabpot added a commit that referenced this pull request Oct 2, 2017
…routes are configured (yceruto)

This PR was merged into the 3.4 branch.

Discussion
----------

[FrameworkBundle][Routing] Show welcome message if no routes are configured

| Q             | A
| ------------- | ---
| Branch?       | 3.4 (it would be good, else 4.1)
| Bug fix?      | no
| New feature?  | yes
| BC breaks?    | no
| Deprecations? | no
| Tests pass?   | yes
| Fixed tickets | symfony/flex#20
| License       | MIT
| Doc PR        | -

Another attempt to improve the first time experience with a different technical approach this time.

Just after a fresh "SymfonyFlex" installation:
```bash
$ composer create-project symfony/skeleton flex
$ cd flex
$ make serve
```

![welcome](https://user-images.githubusercontent.com/2028198/31088339-4b84f95a-a76e-11e7-8b70-be53507f18e1.png)

When the first route is added, this message is no longer displayed (same if debug mode is disabled).

ping @javiereguiluz, @sstok

Commits
-------

e097ab3 Show welcome message if no routing configuration could be found
@yceruto yceruto deleted the welcome branch October 2, 2017 23:40
This was referenced Oct 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants