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

Placeholder and latte helper #76

Open
Libig opened this issue Apr 28, 2015 · 4 comments
Open

Placeholder and latte helper #76

Libig opened this issue Apr 28, 2015 · 4 comments
Labels
Milestone

Comments

@Libig
Copy link

Libig commented Apr 28, 2015

Would be nice to have following possibility in latte:

{capture $loginUrl}<a n:href="Auth:login 'ref' => $currentUrl">{_locale.common.login}</a>{/capture}
<p n:if="!$user->isLoggedIn()">{_locale.common.loginInfo, ['url' => $loginUrl|noescape]}.</p>

It is not possible to use helper (noescape in this case) with placeholder to avoid escaping of captured link.

@fprochazka
Copy link
Member

If you trust the contents of locale.common.loginInfo, simple

{capture $loginUrl}<a n:href="Auth:login 'ref' => $currentUrl">{_locale.common.login}</a>{/capture}
<p n:if="!$user->isLoggedIn()">{!_locale.common.loginInfo, ['url' => $loginUrl]}.</p>

should work

@tomaswindsor
Copy link

And what if you cannot trust the contents of locale.common.loginInfo?

@fprochazka
Copy link
Member

There is no shortcut currently.

@Libig
Copy link
Author

Libig commented Apr 29, 2015

Thanks for the tip, for me it is enough for the moment.

@fprochazka fprochazka added this to the v3.0 milestone May 15, 2017
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

3 participants