1. Home
  2. Docs
  3. Integration of Mavryx wit...
  4. Integration of Mavryx wit...
  5. Template

Template

After installing the bundle, you can also install the Mavryx template.

The default template will be installed in the APP_ROOT/templates folder.

Depending on the state of your project, you can continue using the original template with the compatibility layer and gradually migrate your template to the Mavryx environment, or you can start using the clean Mavryx template from the beginning.

1. Installation with an existing template not compatible with Mavryx

If you already have a template in this folder that is not compatible with Mavryx, move it to the default folder.

The folder structure after this operation should look as follows:

templates/
	default

To install the Mavryx template, execute the following command

php bin/console mavryx:update

The structure should look as follows

templates/
	default
	spring

Next, create a folder where you will keep modifications for the project-specific Mavryx template you are creating. For example, ‘mytemplate’. You can also create a ‘compatibility’ folder where you can keep compatibility layer files between your old template, which is not compatible with Mavryx, and the Mavryx template.

After all these operations, the folder structure should look as follows

templates/
  mytemplate // Your new template
  compatibility // Compatibility layer
  spring // Mavryx template
  default // Your old template

Next, modify the config/packages/twig.yaml file.

paths:
        # directories are relative to the project root dir (but you
        # can also use absolute directories)
        
        # YOUR APP TEMPLATE
        'templates/mytemplate': ~        
        #COMPATIBILITY LAYER
        'templates/compatibility': ~
        #MAVRYX TEMPLATE 
        'templates/spring': ~
        #ORGINAL TEMPLATE
        'templates/default': ~  

2. Installation of only the Mavryx template

To install the Mavryx template, execute the following command

php bin/console mavryx:update

Then create a folder where you will keep modifications specific to the Mavryx template for the project you are creating, for example, ‘mytemplate’.

After all these operations, the folder structure should look like this

templates/
  mytemplate // Your new template
  spring // Mavryx template

Next, modify the config/packages/twig.yaml file


paths:
        # directories are relative to the project root dir (but you
        # can also use absolute directories)
        
        # YOUR APP TEMPLATE
        'templates/mytemplate': ~        
        #MAVRYX TEMPLATE 
        'templates/spring': ~

Was this article helpful to you? No Yes

How can we help?