vendor/sonata-project/admin-bundle/src/Resources/views/CRUD/Association/list_many_to_one.html.twig line 1

Open in your IDE?
  1. {#
  2. This file is part of the Sonata package.
  3. (c) Thomas Rabaix <thomas.rabaix@sonata-project.org>
  4. For the full copyright and license information, please view the LICENSE
  5. file that was distributed with this source code.
  6. #}
  7. {% extends get_admin_template('base_list_field', admin.code) %}
  8. {% block field %}
  9.     {% if value %}
  10.         {% set route_name = field_description.option('route').name|default(sonata_config.getOption('default_admin_route')) %}
  11.         {% set route_parameters = field_description.option('route').parameters|default([]) %}
  12.         {% if not field_description.option('identifier', false)
  13.             and field_description.hasAssociationAdmin
  14.             and field_description.associationadmin.hasRoute(route_name)
  15.             and field_description.associationadmin.hasAccess(route_name, value)
  16.             and field_description.associationadmin.id(value) is not null
  17.         %}
  18.             <a href="{{ field_description.associationadmin.generateObjectUrl(route_name, value, route_parameters) }}">
  19.                 {{ value|render_relation_element(field_description) }}
  20.             </a>
  21.         {% else %}
  22.             {{ value|render_relation_element(field_description) }}
  23.         {% endif %}
  24.     {% endif %}
  25. {% endblock %}