class TranslationViewer (View source)

TranslationViewer

Methods

__construct(EntityManager $entityManager, Settings $settingsBag, RouterInterface $router)

TranslationViewer constructor.

array
getTranslationMenuAssignation(Request $request, boolean $absolute = false)

Return available page translation information.

getTranslation()

No description

setTranslation(Translation $translation)

No description

Details

__construct(EntityManager $entityManager, Settings $settingsBag, RouterInterface $router)

TranslationViewer constructor.

Parameters

EntityManager $entityManager
Settings $settingsBag
RouterInterface $router

TranslationRepository getRepository()

Return Value

TranslationRepository

array getTranslationMenuAssignation(Request $request, boolean $absolute = false)

Return available page translation information.

Be careful, for static routes Roadiz will generate a localized route identifier suffixed with "Locale" text. In case of "force_locale" setting to true, Roadiz will always use suffixed route.

example return value

array (size=3)
  'en' =>
    array (size=4)
        'name' => string 'newsPage'
        'url' => string 'http://localhost/news/test'
        'locale' => string 'en'
        'active' => boolean false
        'translation' => string 'English'
  'fr' =>
    array (size=4)
        'name' => string 'newsPageLocale'
        'url' => string 'http://localhost/fr/news/test'
        'locale' => string 'fr'
        'active' => boolean true
        'translation' => string 'French'
  'es' =>
    array (size=4)
        'name' => string 'newsPageLocale'
        'url' => string 'http://localhost/es/news/test'
        'locale' => string 'es'
        'active' => boolean false
        'translation' => string 'Spanish'

Parameters

Request $request
boolean $absolute Generate absolute url or relative paths

Return Value

array

Translation getTranslation()

Return Value

Translation

TranslationViewer setTranslation(Translation $translation)

Parameters

Translation $translation

Return Value

TranslationViewer