Skip to content
Branch: master
Find file History
rchaliuk and Andrej-in-ua BAP-18989: Remove direct service retrieval - Part 14 (#24285)
- get rid from fetching services from container in:
  - InventoryBundle:InventoryLevelController
  - WarehouseBundle:InventoryLevelController
  - VisibilityCacheBuildCommand
  - OroTranslationDumpCommand
  - ContentProviderListener
Latest commit 4ae7a10 Jun 24, 2019
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
Asset BAP-7171: Implement assets version for our JS files. Add assets versi… Jan 13, 2016
Cache BAP-17493: Upgrade Twig to version 2 (#23712) Jun 6, 2019
Configuration OPA-85: Apply new CS to eliminate manual CS checks by developers duri… Feb 20, 2018
ContentProvider BAP-16500: Change DependencyInjection component (#16634) Feb 16, 2018
Controller BAP-17040: Update application structure to Symfony 4 (#18137) May 15, 2018
Converter BAP-1893: Convert PHP formats to JS formats Oct 21, 2013
DependencyInjection BAP-18711: Remove usages of addClassesToCompile (#23973) May 23, 2019
Event BAP-17493: Upgrade Twig to version 2 (#23712) Jun 6, 2019
EventListener BAP-18989: Remove direct service retrieval - Part 14 (#24285) Jun 24, 2019
Exception CRM-3474: Formatters for twig Jun 18, 2015
Fallback OPA-85: Apply new CS to eliminate manual CS checks by developers duri… Feb 20, 2018
Form Merge branch 'master' into feature/BB-13929_refactoring_gdpr_for_3_1_lts Dec 26, 2018
Formatter BAP-18430: OAuth App Creation Email Notification (#23143) Mar 25, 2019
Layout/Extension BAP-16716: Remove OptionsResolver deprecations (#17142) Mar 12, 2018
Migrations/Data/ORM BAP-18279: Move feature configuration YAML files cache from Applicati… Feb 12, 2019
Model BAP-15849: Upgrade 2.x LTS releases to latest Symfony 2.8.x version (… Dec 13, 2017
Placeholder BAP-18279: Move feature configuration YAML files cache from Applicati… Feb 12, 2019
Provider BAP-18279: Move feature configuration YAML files cache from Applicati… Apr 20, 2019
Resources BAP-18989: Remove direct service retrieval - Part 14 (#24285) Jun 24, 2019
Route OPA-85: Apply new CS to eliminate manual CS checks by developers duri… Feb 20, 2018
Tests BAP-18989: Remove direct service retrieval - Part 14 (#24285) Jun 24, 2019
Tools BAP-17237: Remove deprecated method Oro\Component\PhpUtils\ArrayUtil:… Oct 12, 2018
Twig BAP-18709 Remove direct service retrieval (#24172) Jun 6, 2019
Validator/Constraints OPA-85: Apply new CS to eliminate manual CS checks by developers duri… Feb 20, 2018
View BAP-16245: Set sub-block data (#15638) Dec 20, 2017
OroUIBundle.php OPA-85: Apply new CS to eliminate manual CS checks by developers duri… Feb 20, 2018
README.md CRM-9123: CRITICAL: Cannot instantiate abstract class Oro\Bundle\UIBu… Feb 19, 2019

README.md

OroUIBundle

OroUIBundle defines the architecture of the front-end part of Oro application and provides tools that ensure the coordinated work of the architecture parts.

Table of Contents

Configuration Settings

  • oro_ui.application_url - application frontend URL
  • oro_ui.application_name - application name to display in header
  • oro_ui.application_title - application title for name reference in header

Introduction to placeholders

In order to improve layouts and make them more flexible a new twig token placeholder is implemented. It allows us to combine several blocks (templates or actions) and output them in different places in twig templates. This way we can customize layouts without modifying twig templates.

Placeholder declaration in YAML

Placeholders can be defined in any bundle under /SomeBundleName/Resource/oro/placeholders.yml

placeholders:
    items:                             # items to use in placeholders (templates or actions)
     <item_name>:                      # any unique identifier
        template: <template>           # path to custom template for renderer
     <another_item_name>:
        action: <action>               # action name (e.g. OroSearchBundle:Search:searchBar)
    
    placeholders:
      <placeholder_name>:
        items:
          <item_name>:
            order: 100                 # sort order in placeholder
          <another_item_name>:
            order: 200
          <one_more_item_name>: ~      # sort order will be set to 0

Any configuration defined in bundle placeholders.yml file can be overridden in config/config.yml file.

oro_ui:
    placeholders:
        <placeholder_name>:
            items:
                <item_name>:
                    remove: true   # remove item from placeholder
        <another_placeholder_name>:
            items:
                <item_name>:
                    order: 200     # change item order in placeholder

Each placeholder item can have the following properties:

  • template or action - The path to TWIG template or controller action is used to rendering the item.
  • applicable - The condition indicates whether the item can be rendered or not.
  • acl - The ACL resource(s). Can be a string or array of strings. Can be used to restrict access to the item. If several ACL resources are provided an access is granted only if all of them grant an access.
  • data - An additional data to be passed to TWIG template or controller.

Each property can be a constant or some expression supported by System Aware Resolver Component. Examples can be found in existing placeholders.yml files.

Rendering placeholders

To render placeholder content in twig template we need to put

{% placeholder <placeholder_name> %}

Additional options can be passed to all placeholder child items using with e.g.

{% placeholder <placeholder_name> with {'form' : form} %}
You can’t perform that action at this time.