Skip to content

[Profiler] make it possible to omit the link var #17402

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

Merged
merged 1 commit into from
Jan 25, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div class="sf-toolbar-block sf-toolbar-block-{{ name }} sf-toolbar-status-{{ status|default('normal') }} {{ additional_classes|default('') }}">
{% if link %}<a href="{{ path('_profiler', { token: token, panel: name }) }}">{% endif %}
{% if link is defined and link %}<a href="{{ path('_profiler', { token: token, panel: name }) }}">{% endif %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we use {% if link|default(false) %} instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could, do you think that's more readable?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this happens to others, but when I read this code: if link is defined and link it looks to me like something is missing (try to read it as a regular English phrase ... it ends abruptly and it's weird; it should be if link is defined and link is true).

But never mind about my comment ... let's keep your original code.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's see what the other @symfony/deciders think. I am happy to change the code if they agree with you.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xabbuh what do you think about rename link by show_link? link looks as though a URL is required to access of the profile panel IMO.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

<div class="sf-toolbar-icon">{{ icon|default('') }}</div>
{% if link %}</a>{% endif %}
{% if link is defined and link %}</a>{% endif %}
<div class="sf-toolbar-info">{{ text|default('') }}</div>
</div>