Skip to content

Instantly share code, notes, and snippets.

@chanmix51
Created October 20, 2011 16:23
Show Gist options
  • Save chanmix51/1301587 to your computer and use it in GitHub Desktop.
Save chanmix51/1301587 to your computer and use it in GitHub Desktop.
Registering twig sandbox in SF2
parameters:
policy.tags: [if]
policy.filters: [upper]
policy.methods: { Article: [getTitle]}
policy.properties: { Article: [excerpt]}
policy.function: [range]
services:
twig.extension.sandbox.policy:
class: Twig_Sandbox_SecurityPolicy
arguments: [ %policy.tags%, %policy.filters%, %policy.methods%, %policy.properties%, %policy.function% ]
twig.extension.sandbox:
class: Twig_Extension_Sandbox
arguments: [@twig.extension.sandbox.policy]
tags:
-: {name: twig.extension }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment