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

Better support for ternary operator #881

Closed
3 tasks
wisskid opened this issue Apr 30, 2023 · 0 comments
Closed
3 tasks

Better support for ternary operator #881

wisskid opened this issue Apr 30, 2023 · 0 comments
Milestone

Comments

@wisskid
Copy link
Contributor

wisskid commented Apr 30, 2023

Smarty has support for the ternary operator since 2009/2010. But it was never documented. Also, it requires the testing expression to be in parentheses. So this works now:

{($foo) ? $var1 : $var2}

But this will not:

{$foo ? $var1 : $var2}

There is no support for the shorthand ?: version.

  • Change the implementation to make the parentheses optional
  • Support the shorthand version as well
  • Document the implementation
@wisskid wisskid added this to the 5.0 milestone May 1, 2023
@wisskid wisskid closed this as completed in 8fd949a Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant