@Template annotation generate wrong path
See original GitHub issueWhen you have controller named with two or more words (e.g. StaticPageController) and use @Template annotation it generated folder StaticPage in views, but Symfony expects static_page.
Steps to reproduce
- Create this controller
class StaticPageController extends Controller
{
/**
* @Route("/about-us", name="about-us")
* @Template
*/
public function aboutUsAction()
{
}
}
- Use function “Twig: Create Template” (It creates Resources/views/StaticPage/AboutUs.html.twig)
- Run server
- Go to address /about-us
What is the result
Error message “Unable to find template “AppBundle/static_page/about_us.html.twig””
What should be the result
Plugin should generate folders and files with snake_case, not with camelCase (it is also written here in best practices)
Issue Analytics
- State:
- Created 6 years ago
- Reactions:7
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Why wrong path annotation doesn't crash REST API with ...
Don't really know. However, worth to try with a correct Path annotation. Maybe it is ignoring it as it was wrong. Try to...
Read more >Configure annotation processors | IntelliJ IDEA Documentation
The annotation processor can validate, generate, and modify your code ... you need to add a path of the annotation processor JAR manually....
Read more >Java Annotation Processing and Creating a Builder - Baeldung
Here's an example of adding annotation processor for the compiler plugin. You could also specify the directory to put generated sources into, ...
Read more >Creating a RESTful Root Resource Class - The Java EE 6 ...
The @Path annotation identifies the URI path template to which the resource ... The ResponseBuilder class provides a convenient way to create a...
Read more >Agent Sidecar Injector Annotations | Vault
To map a path to a specific secret, use the same unique secret name: vault.hashicorp.com/secret-volume-path-SECRET-NAME . For example, if a secret annotation ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Fixed by #1389
Blast from the past, I have no idea.
I’d try to add it to
ide-twig.json
(example)