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

IN operator #27

Closed
hrach opened this issue Jul 4, 2014 · 4 comments
Closed

IN operator #27

hrach opened this issue Jul 4, 2014 · 4 comments
Labels

Comments

@hrach
Copy link
Contributor

@hrach hrach commented Jul 4, 2014

I would like to use something like:

{if $entry->type in [image, video]}

to be transformed to

if (in_array($entry->type, ['image', 'video'], TRUE)) {
@hrach hrach added the enhancement label Jul 4, 2014
@xificurk

This comment has been minimized.

Copy link
Contributor

@xificurk xificurk commented Jul 4, 2014

👍

1 similar comment
@vysinsky

This comment has been minimized.

Copy link

@vysinsky vysinsky commented Jul 4, 2014

👍

@mishak87

This comment has been minimized.

Copy link
Contributor

@mishak87 mishak87 commented Jul 4, 2014

{if $x|in:a,b,c,d}

Wrapping expressions with helpers would be more robust solution.
AFAIK proper implementation of {if $x in [a, b, c]} would require tokenizing whole expression and simple implementation will be messy ie.: {if $x in [1, 7] || $x % 2}.

@dg

This comment has been minimized.

Copy link
Member

@dg dg commented Jul 7, 2014

👍

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