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

Adopted template overriding from other actions like update #675

Merged
merged 2 commits into from
Jan 10, 2014

Conversation

snc
Copy link
Contributor

@snc snc commented Dec 3, 2013

Currently when you use the SyliusResourceBundle standalone, when you want to override the template for the delete action you have to define it this way:

my_delete:
    pattern: /my/{id}
    methods: [DELETE]
    defaults:
        _controller: my.controller.my:deleteAction
        template: MyCoreBundle:My:delete.html.twig

This is inconsistent with the other actions. This PR changes this so that it works with the folloging syntax:

my_delete:
    pattern: /my/{id}
    methods: [DELETE]
    defaults:
        _controller: my.controller.my:deleteAction
        _sylius:
            template: MyCoreBundle:My:delete.html.twig

Before merging this PR we should reconfigure the routes so that SyliusWebBundle:Backend/Misc:delete.html.twig will be used again ;-)

Currently when you use the `SyliusResourceBundle` standalone, when you want to override the template for the delete action you have to define it this way:

``` yaml
my_delete:
    pattern: /my/{id}
    methods: [DELETE]
    defaults:
        _controller: my.controller.my:deleteAction
        template: MyCoreBundle:My:delete.html.twig
```

This is inconsistent with the other actions. This PR changes this so that it works with the folloging syntax:

``` yaml
my_delete:
    pattern: /my/{id}
    methods: [DELETE]
    defaults:
        _controller: my.controller.my:deleteAction
        _sylius:
            template: MyCoreBundle:My:delete.html.twig
```

Before merging this PR we should reconfigure the routes so that `SyliusWebBundle:Backend/Misc:delete.html.twig` will be used again ;-)
@pjedrzejewski
Copy link
Member

👍

@snc
Copy link
Contributor Author

snc commented Dec 3, 2013

I can adjust the routes if you want, I just wanted to wait for feedback ;-)

@pjedrzejewski
Copy link
Member

@snc Yes, please! Obviously I'm in favor of this change. thank you. :)

@snc
Copy link
Contributor Author

snc commented Dec 3, 2013

Done, travis is working hard to test this PR now ;-)

@snc
Copy link
Contributor Author

snc commented Dec 3, 2013

Looks good, there are some Class GeoJson\Geometry\Geometry does not exist errors but those are not related to this PR.

stloyd added a commit that referenced this pull request Jan 10, 2014
Adopted template overriding from other actions like update
@stloyd stloyd merged commit 46f6214 into Sylius:master Jan 10, 2014
@stloyd
Copy link
Contributor

stloyd commented Jan 10, 2014

Merged. Thanks Henrik!

mtotheikle pushed a commit to Limelyte/Sylius that referenced this pull request Jan 22, 2014
Merge pull request Sylius#675 from snc/patch-1

Adopted template overriding from other actions like update
pamil pushed a commit to pamil/Sylius that referenced this pull request May 7, 2019
Adopted template overriding from other actions like update
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Enhancement Minor issues and PRs improving the current solutions (optimizations, typo fixes, etc.). UX Issues and PRs aimed at improving User eXperience.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants