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.options.route.name %}
  11.         {% if not field_description.options.identifier|default(false)
  12.             and field_description.hasAssociationAdmin
  13.             and field_description.associationadmin.hasRoute(route_name)
  14.             and field_description.associationadmin.hasAccess(route_name, value)
  15.             and field_description.associationadmin.id(value)
  16.         %}
  17.             <a href="{{ field_description.associationadmin.generateObjectUrl(route_name, value, field_description.options.route.parameters) }}">
  18.                 {{ value|render_relation_element(field_description) }}
  19.             </a>
  20.         {% else %}
  21.             {{ value|render_relation_element(field_description) }}
  22.         {% endif %}
  23.     {% endif %}
  24. {% endblock %}