Difference between revisions of "ARK2/Templates"

From ARK
Jump to: navigation, search
(Templates)
(Extensions)
 
(3 intermediate revisions by the same user not shown)
Line 14: Line 14:
  
 
* ARK:
 
* ARK:
** translate: An extension to the standard Symfony trans option to add support for ARK Translation Roles, see [[ARK2/Localization#Translation|Translation page]].
+
** service: A global variable to access the ARK Service object.
** translatechoice: An extension to the standard Symfony transchoice option to add support for ARK Translation Roles, see [[ARK2/Localization#Translation|Translation page]].
+
** translate: An extension to the standard Symfony trans option to add support for ARK Translation Roles, see [[ARK2/Localization#Translation|Translation]].
 +
** translatechoice: An extension to the standard Symfony transchoice option to add support for ARK Translation Roles, see [[ARK2/Localization#Translation|Translation]].
  
 
* [http://silex.sensiolabs.org/doc/providers/twig.html Silex/Symfony Extensions] , in particular:
 
* [http://silex.sensiolabs.org/doc/providers/twig.html Silex/Symfony Extensions] , in particular:
Line 21: Line 22:
 
** [http://symfony.com/doc/current/reference/forms/twig_reference.html Forms]
 
** [http://symfony.com/doc/current/reference/forms/twig_reference.html Forms]
 
** [http://symfony.com/doc/current/book/security.html#access-control-in-templates Security]
 
** [http://symfony.com/doc/current/book/security.html#access-control-in-templates Security]
** Global variables for: request, session, user, debug
+
** Asset
 +
** Global variables for: app, request, session, user, debug
  
* [http://twig.sensiolabs.org/doc/extensions/index.html Official Twig Extensions]:
+
* [http://twig.sensiolabs.org/doc/extensions/index.html Official Twig Extensions], in particular:
 
** Text: Provides useful filters for text manipulation;
 
** Text: Provides useful filters for text manipulation;
 
** Intl: Adds a filter for localization of DateTime objects, numbers and currency;
 
** Intl: Adds a filter for localization of DateTime objects, numbers and currency;
 
** Array: Provides useful filters for array manipulation;
 
** Array: Provides useful filters for array manipulation;
 
** Date: Adds a filter for rendering the difference between dates.
 
** Date: Adds a filter for rendering the difference between dates.

Latest revision as of 14:54, 2 January 2017

Templates

ARK2 uses the TWIG templating engine to define the Front-end web views.

See the Twig documentation on general use of Twig.

See the Silex documentation for using TWIG with the Silex Framework.

See the Symfony documentation for using TWIG with the Symfony Components

Extensions

TWIG can easily be extended with custom extensions to the template language. ARK2 ships with a number of common extensions, as well as some ARK-specific extensions.

  • ARK:
    • service: A global variable to access the ARK Service object.
    • translate: An extension to the standard Symfony trans option to add support for ARK Translation Roles, see Translation.
    • translatechoice: An extension to the standard Symfony transchoice option to add support for ARK Translation Roles, see Translation.
  • Official Twig Extensions, in particular:
    • Text: Provides useful filters for text manipulation;
    • Intl: Adds a filter for localization of DateTime objects, numbers and currency;
    • Array: Provides useful filters for array manipulation;
    • Date: Adds a filter for rendering the difference between dates.