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

Can't pass function result to mixin directly #92

Closed
J5lx opened this issue Nov 27, 2016 · 4 comments
Closed

Can't pass function result to mixin directly #92

J5lx opened this issue Nov 27, 2016 · 4 comments
Assignees
Labels
Milestone

Comments

@J5lx
Copy link

J5lx commented Nov 27, 2016

This code:

.form__element
  +site-select(trans('auth.signin.site'))

results in trans('auth.signin.site' Missing closing: ).

However this code works just fine:

.form__element
  - $placeholder = trans('auth.signin.site')
  +site-select($placeholder)

Same code in JS syntax works as well:

.form__element
  - placeholder = trans('auth.signin.site')
  +site-select(placeholder)

MWE for site-select:

mixin site-select(placeholder)
  = placeholder

Possibly related: #84

@J5lx J5lx changed the title Can't pass function result to mixin Can't pass function result to mixin directly Nov 27, 2016
@kylekatarnls
Copy link
Member

Thanks, I think it could be fixed in the mixin call RegExp.

@kylekatarnls kylekatarnls added this to the 2.5 milestone Dec 2, 2016
@kylekatarnls
Copy link
Member

Hi, I have still some adjustements to do to perfectly handle parentheses in mixin calls but you can yet composer update to get Pug 2.4.9 to calls like +site-select(trans('auth.signin.site')) in your templates.

@kylekatarnls kylekatarnls self-assigned this Dec 11, 2016
@kylekatarnls
Copy link
Member

Now, mixin calls should handle any valid PHP syntax in it. Just upgrade to the version 2.5.0

@J5lx
Copy link
Author

J5lx commented Jan 21, 2017

I finally got to try this out, and I can confirm that it works. Thanks! I'll have a look at the magic method thing next.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants