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

Feature Request: Twig {% switch %} #5364

steve-buri opened this issue Dec 3, 2019 · 3 comments


Copy link

@steve-buri steve-buri commented Dec 3, 2019

Feature Request

Feature description

A switch equal to

If you currently use {% switch %} {% endswitch %} inside a custom area brick, you will receive the message "Unknown "switch" tag. Did you mean "with"?"

Steps to test the feature

Create a folder inside app/Ressources/views/Areas/test/> named view.html.twig
Create a file inside src/AppBundle/Document/Areabricknamed Test.php

Code example

// Test.php
namespace AppBundle\Document\Areabrick;

class Test extends AbstractAreabrick
     * {@inheritdoc}
    public function getName()
        return 'Test';
{# app/Ressources/views/Areas/test/view.html.twig #}

{% set var = "text" %}
{% switch var %}
 {% case "text" %}
    <p>switch works!</p>
{% endswitch %}

Thanks in advance

@steve-buri steve-buri changed the title Feature Request: Twig {% switch }% Feature Request: Twig {% switch %} Dec 3, 2019

This comment has been minimized.

Copy link

@dpfaffenbauer dpfaffenbauer commented Dec 3, 2019

Switch is not a standard Twig Feature, if you want to have it, you can install custom bundles that add it for you.... I don't think that is a requirement Pimcore needs.


This comment has been minimized.

Copy link

@steve-buri steve-buri commented Dec 5, 2019

Would be nice to have, but yes. We will add in manually.
Thanks @dpfaffenbauer

@steve-buri steve-buri closed this Dec 5, 2019

This comment has been minimized.

Copy link

@dpfaffenbauer dpfaffenbauer commented Dec 5, 2019

separation of concerns is the key argument here ;) Thanks for your understanding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.