Overview

Namespaces

  • ApiBundle
    • DataFixtures
      • Faker
        • Provider
    • DependencyInjection
    • Doctrine
      • DBAL
        • Type
      • ORM
        • Filter
          • User
    • Entity
    • EventListener
      • Doctrine
    • Manager
    • Utils
  • FrontBundle
    • Bundle
      • UserBundle
    • Client
      • Exception
    • Controller
    • DependencyInjection
    • Form
      • DataTransformer
      • Type
    • Menu
    • Security
      • Http
        • Authentication
    • Services
      • Http
    • Twig
    • Utils

Classes

  • FrontExtension
  • Overview
  • Namespace
  • Class

Class FrontExtension

Class FrontExtension: class used to create custom Twig functionalities and filters.

Twig_Extension
Extended by FrontBundle\Twig\FrontExtension
Namespace: FrontBundle\Twig
Author: Théo FIDRY theo.fidry@gmail.com
Located at FrontBundle/Twig/FrontExtension.php
Methods summary
public
# getFilters( )
public string
# uriIdFilter( $uri )

Extract the ID which is given in URI form (typically in the @id tag).

Extract the ID which is given in URI form (typically in the @id tag).

This is done by extracting the last part of the URI.

Parameters

$uri

Returns

string

Example

uriIdFilter('/api/users/101') // "101" uriIdFilter('/api/mandates/AaKxazRT') // "AaKxazRT" uriIdFilter('/api/') // ""


public string
# userTopRoleFilter( array $roles )

Reformat role in a clean way. This filter assumes that the roles passed are known to FrontBundle\Utils\RoleHierarchyHelper and formatted following the ROLE_%s mask.

Reformat role in a clean way. This filter assumes that the roles passed are known to FrontBundle\Utils\RoleHierarchyHelper and formatted following the ROLE_%s mask.

Parameters

$roles
Array of valid Symfony roles.

Returns

string
Formatted top role if role known, empty string otherwise.

Example

roleFilter(['ROLE_USER']) // "user" roleFilter(['ROLE_ADMIN']) // "admin" roleFilter(['ROLE_SUPER_ADMIN']) // "root"


public
# getName( )
API documentation generated by ApiGen