Updated: Comment 0

Problem/Motivation

Symfony fullframework does offer two different ways to provide some url in some template: url() and path()

url() just generates an url while path() produces an absolute version, so including the domain and co.

Proposed resolution

Remaining tasks

Decide whether this is really a needed functionality for drupal.

User interface changes

API changes

Comments

steveoliver’s picture

I'd say

{% if path(route_name) === url(route_name, {'absolute': 1}) %}
this.closed
{% endif %}

Also, with a function called "path" in twig, one may expect it at first glance to generate a Drupal path i.e. from a route name.

Cottser’s picture

Issue summary: View changes
Issue tags: +Twig
dawehner’s picture

Status: Active » Fixed

Note: https://www.drupal.org/files/issues/twig_url-2073811-171.patch added one, so I guess this is fixed?

Cottser’s picture

Great! :D

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.