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

Twig tag cannot get resolved inside nav_widget tag #8101

Closed
kafuton opened this issue Apr 16, 2015 · 1 comment
Closed

Twig tag cannot get resolved inside nav_widget tag #8101

kafuton opened this issue Apr 16, 2015 · 1 comment

Comments

@kafuton
Copy link

kafuton commented Apr 16, 2015

Code is as below:

{{ nav_widget({
'options': {
'class': 'navbar-nav navbar-right',
},
'items': [
{ 'label': "Welcome, {{ app.user.identity.username }}", 'items': [ { 'label': 'Logout', 'url': '/site/logout', 'linkOptions': { 'data-method': 'post' } } ] }
]
}) }}

If the logged in username is 'James', but what displayed on web is still {{ app.user.identity.username }}. Thus the twig tag {{ app.user.identity.username }} is not resolved in such case.

Any suggestion?

@vitalik74
Copy link

Use "Welcome, " ~ app.user.identity.username. See doc http://twig.sensiolabs.org/doc/templates.html#other-operators

@samdark samdark closed this as completed Apr 16, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants