OroPlatform Forums

Covering OroPlatform topics, including community updates and company announcements.

Forums Forums OroPlatform OroPlatform – Programming Questions datagrid.yml – pass parameters to template

This topic contains 4 replies, has 3 voices, and was last updated by  jakabadambalazs 5 years, 9 months ago.

Starting from March 1, 2020 the forum has been switched to the read-only mode. Please head to StackOverflow for support.

  • Creator
    Topic
  • #33604

    jakabadambalazs
    Participant

    Would it be possible to pass parameters to a twig template when rendering a datagrid column like:


    oro/platform(1.6.2) + oro/doctrine-extensions(1.0.7) + symfony/symfony(v2.3.27)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Author
    Replies
  • #33605
    ignat
    ignat
    Participant

    Hi,

    There is an option “context” where you can place any additional variables. Check this https://github.com/orocrm/platform/blob/1.4/src/Oro/Bundle/DataGridBundle/Extension/Formatter/Property/TwigTemplateProperty.php#L53. So in your case column config will be next:

    Thanks,
    Ignat

    #33606

    jakabadambalazs
    Participant

    Thanks @ignat – it works ;)!


    oro/platform(1.6.2) + oro/doctrine-extensions(1.0.7) + symfony/symfony(v2.3.27)

    #33607

    Alexandr Smaga
    Participant

    Hi ! Here is some documentation for twig property.

    #33608

    jakabadambalazs
    Participant

    Tnx, very useful.


    oro/platform(1.6.2) + oro/doctrine-extensions(1.0.7) + symfony/symfony(v2.3.27)

Viewing 4 replies - 1 through 4 (of 4 total)

The forum ‘OroPlatform – Programming Questions’ is closed to new topics and replies.

You will be redirected to [title]. Would you like to continue?

Yes No