Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update docs in order to avoid calling deprecated methods setTemplate() and setTemplates() in AbstractAdmin #6538

Closed
wants to merge 2 commits into from

Conversation

phansys
Copy link
Member

@phansys phansys commented Oct 24, 2020

Subject

Update docs about templates.

PR #6387 deprecates methods AbstractAdmin::setTemplate() and AbstractAdmin::setTemplates(), but the documentation still recommends to use them.
These calls were updated in order to use the template registry services.

I am targeting this branch, because these changes respect BC.

Related to #6387.

Changelog

### Fixed
- Deprecated calls to `AbstractAdmin::setTemplate()` and `AbstractAdmin::setTemplates()` in docs.

@phansys phansys added the docs label Oct 24, 2020
@phansys phansys requested a review from a team October 24, 2020 12:45
@phansys phansys marked this pull request as ready for review October 24, 2020 12:48
@greg0ire
Copy link
Contributor

Documentation is not that different from code: it does deserve separate commits for grammar fixes and for other things. Also, it does deserve descriptive commit messages that explain what you are doing, not just which area of the docs you are working on. Typically, this should appear in your commit message:

deprecates methods AbstractAdmin::setTemplate() and AbstractAdmin::setTemplates(), but the documentation still recommends to use them.

@phansys phansys changed the title Update docs about templates Update docs in order to avoid calling deprecated methods setTemplate() and setTemplates() in AbstractAdmin Oct 24, 2020
@phansys phansys requested a review from greg0ire October 24, 2020 14:22
@phansys
Copy link
Member Author

phansys commented Oct 24, 2020

The commit and the PR description were updated. Please, let me know if it accomplish your expectations.

docs/cookbook/recipe_row_templates.rst Outdated Show resolved Hide resolved
docs/cookbook/recipe_row_templates.rst Show resolved Hide resolved
docs/reference/templates.rst Show resolved Hide resolved
docs/reference/templates.rst Outdated Show resolved Hide resolved
is available through ``$this->getTemplateRegistry()`` within the ``Admin``.
Using the service container the template registries can be accessed outside an ``Admin``.
Use the ``Admin`` code + ``.template_registry`` as the service ID (i.e.
"app.admin.post" uses the template registry "app.admin.post.template_registry").
Copy link
Contributor

@greg0ire greg0ire Oct 24, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd use code markup here, but it's funny, that's the second time I have this discussion today, so don't hesitate to tell me if you feel strongly otherwise.

Suggested change
"app.admin.post" uses the template registry "app.admin.post.template_registry").
``app.admin.post`` uses the template registry ``app.admin.post.template_registry``).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think there is no established rule for the case where we need to refer to service names, parameter names, package names, etc. (since they are names, sometimes it feels natural to use double quotes and treat them a literal strings).
Personally, I try to be consistent with this, but in some cases it depends on the context, I think.
In the same reasoning, I try to use backticks when referencing code snippets (with partial or complete fragments, IE AdminInterface::id()).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI the discussion I linked resolved in using backticks (there was no debate, we needed both backticks and quotes). I tend to use backticks for everything. So to me you can write "admin class", you can also write Admin class, but you can't write Admin class, because now you are using a technical name as it appears in the code, and names that appear in code may contain special characters that have meaning in markdown like underscores or stars, but also in normal language, for example dots. When you use backticks, a monospace font will be used, and the reader knows you are talking about something that will appear in the code, and not approximately referring to something using a high level term like "unit of work" or "repository interface".

…()` and `setTemplates()` in `AbstractAdmin`

PR sonata-project#6387 deprecates methods `AbstractAdmin::setTemplate()` and `AbstractAdmin::setTemplates()`,
but the documentation still recommends to use them.
These calls were updated in order to use the template registry services.
@phansys phansys requested review from greg0ire and a team October 24, 2020 16:49
@phansys phansys requested a review from a team October 25, 2020 06:18
@phansys
Copy link
Member Author

phansys commented Oct 30, 2020

I am trying to test this change locally and I cannot make it work as I supposed.
@wbloszyk, could you please take a look in order to confirm?

@wbloszyk
Copy link
Member

I busy today. I have to finish some of my commercial works. I will try to find some time for it tomorrow. IMO it is problem with template registry which is created by compiler pass and do not exist when config is loaded.

@phansys
Copy link
Member Author

phansys commented Oct 30, 2020

I agree with that suspicion.
Thank you.

@wbloszyk
Copy link
Member

My idea is create one, global admin template registry and force people to create own (by override default) if they want override templates.

<service id="sonata.media.admin.media.template_registry">
    <tag name="sonata.teplate_registry"/>
    <call method="setTemplates">
       ...
    </call>
</service>
<service id="sonata.media.admin.media">
    <tag name="sonata.admiun"/>
    <call method="setTemplateRegistry">
       <argument type="service" id="sonata.media.admin.media.template_registry"> 
    </call>
</service>

Im feature will be nice to add multiple registry for one admin. Support for role, destiny (chooseable show as table or thumbnail etc.)

@phansys
Copy link
Member Author

phansys commented Oct 30, 2020

I understand. But I also think that we shouldn't deprecate AbstractAdmin::setTemplate() in favor of this approach, if isn't working yet.

@jordisala1991
Copy link
Member

I understand. But I also think that we shouldn't deprecate AbstractAdmin::setTemplate() in favor of this approach, if isn't working yet.

Agree with that, IMO we should undeprecate this until a fully working solution can be provided, and only if it is better than simply calling setTemplate

@wbloszyk
Copy link
Member

I will try do it tomorrow.

@wbloszyk wbloszyk closed this Oct 30, 2020
@wbloszyk wbloszyk reopened this Oct 30, 2020
@wbloszyk
Copy link
Member

Miss click 😆

@wbloszyk
Copy link
Member

@phansys
I found resolve for it.
At first global template registry should be non changeable:
#6556

At second:
MutableTemplateRegistry should have parent property. (for global settings)

At third:
User will be able to create MutableTemplateRegistry by own. Compiler pass will create or call setters then.

@phansys
Copy link
Member Author

phansys commented Nov 1, 2020

At third:
User will be able to create MutableTemplateRegistry by own. Compiler pass will create or call setters then.

Could you please share an example about the required DI configuration to customize an admin template?

IE:

BEFORE:

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]    

AFTER:

# ...

@wbloszyk
Copy link
Member

wbloszyk commented Nov 1, 2020

Compiler pass will auto inject admin_code.template_registry to admin_code when setTemplateRegistry is not call. So user will be able to set it with custom name too. Set template will be able by arguments too. I want add parent template registry (to reference for global values) or add template manager.

BEFORE:

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]    

AFTER:

admin.foo.template_registry:
   class: Sonata\AdminBundle\Templating\MutableTemplatingRegistry # IMO this can be set by tag, then class will be optional
   tags: 
       - [name: "sonata.template_registry"]
   calls:
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]    

@phansys
Copy link
Member Author

phansys commented Nov 1, 2020

Currently, the custom definition of admin.foo.template_registry is being overridden by the default definition. What do you suggest to fix that?
I insist that, if we aren't able to provide a working solution with this approach, we MUST undeprecate the previous one #6538 (comment), #6538 (comment).

@wbloszyk
Copy link
Member

wbloszyk commented Nov 1, 2020

@phansys IMO this should resolve problem with config. Can you check it? #6561

@VincentLanglet
Copy link
Member

It seems that we are discussing 2 different things here.
IMO, we must focus on fix the current situation: we've deprecated an existing feature indicating that other approach must be followed, and that approach isn't working. So, we must undeprecate the previous working feature.
When that issue is solved, we can invest our effort in providing the new feature in a proper way (adding the required tests to ensure it is working, this time).

Could you please confirm that's how you've set your priorities about this?

After reading all this discussion, I just feel like this feature is not ready and was maybe not discuss enough.
IMHO this should not be in the next major (which we try to release ASAP).

This PR:

IMHO, we should just revert it and delay these changes for 5.0 if it's not ready and fully working.

Plus now I (maybe) start to understand it, I don't see the interest in this feature.
The change

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]  

to

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplateRegistry, '@admin.foo.template_registry']

admin.foo.template_registry:
   class: Sonata\AdminBundle\Templating\MutableTemplatingRegistry # IMO this can be set by tag, then class will be optional
   tags: 
       - [name: "sonata.template_registry"]
   calls:
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]

does not seem a good thing to me.

Setting a templating is actually so easy that it doesn't need a service for this.

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplateRegistry, '@admin.foo.template_registry']

admin.foo_bar:
   class: App\FooBarAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplateRegistry, '@admin.foo.template_registry']

admin.foo.template_registry:
   class: Sonata\AdminBundle\Templating\MutableTemplatingRegistry # IMO this can be set by tag, then class will be optional
   tags: 
       - [name: "sonata.template_registry"]
   calls:
       - [setTemplate, ['show', 'admin/foo/show.html.twig']]
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]

Can just be done this way

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplate, ['show', 'admin/foo/show.html.twig']]  
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]

admin.foo_bar:
   class: App\FooBarAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplate, ['show', 'admin/foo/show.html.twig']]  
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]

and I find this simpler.

Personally when I override show/edit template, it's alway for one single Admin. Asking me to create a service everytime I need to override a template would be counter productive. Did I missunderstood something @wbloszyk @phansys ?

Maybe both way should co-exist:

  • if you want to override template for one admin: use setTemplate
  • if you want to override template for multiple admin: use service

@phansys
Copy link
Member Author

phansys commented Nov 2, 2020

@phansys IMO this should resolve problem with config. Can you check it? #6561

I can confirm it isn't working. You could check locally by introspecting the compiled debug container in your environment (var/cache/{env}/Kernel{env}DebugContainer.xml) and searching for admin.product.template_registry.

Personally when I override show/edit template, it's alway for one single Admin. Asking me to create a service everytime I need to override a template would be counter productive. Did I missunderstood something @wbloszyk @phansys ?

I understand exactly the same. Please, note that I've created this PR by guessing what was done at #6387, but I'm not have certainty about the required steps to replace the deprecated feature.
I agree that AbstractAdmin::setTemplate() seems much more simpler than the approach introduced in that PR.

@wbloszyk
Copy link
Member

wbloszyk commented Nov 2, 2020

#6556 should in 3.x. Other step in master or in 4.x.

IMO keep this methods is bad decision. Templates should be manage by templates registry. But we can keep calling setters by catching this args, inject it by argument and remove and remove calling in compiler pass.

WDYT?

@VincentLanglet
Copy link
Member

IMO keep this methods is bad decision. Templates should be manage by templates registry.

Why should it be ?
Creating a service to change the templates of multiple admins is not a bad idea.
But creating a service for changing one template seems over-engineered.

But we can keep calling setters by catching this args, inject it by argument and remove and remove calling in compiler pass.

I'm not sure to fully understand. Do you want to auto-generate a templateRegistry if we provide setTemplate ?

Can you provide a way to have both this config

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplateRegistry, '@admin.foo.template_registry']

admin.foo.template_registry:
   class: Sonata\AdminBundle\Templating\MutableTemplatingRegistry # IMO this can be set by tag, then class will be optional
   tags: 
       - [name: "sonata.template_registry"]
   calls:
       - [setTemplate, ['show', 'admin/foo/show.html.twig']]
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]

and this config

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplate, ['show', 'admin/foo/show.html.twig']]  
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]

working ?

@VincentLanglet
Copy link
Member

I just thought about a special case

admin.foo1:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplate, ['show', 'admin/foo/show.html.twig']]  
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]

admin.foo2:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]

admin.foo3:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplate, ['show', 'admin/foo/show.html.twig']]

With template registry, you need to create 3 services because admin.foo1 can't set multiple templateRegistry.
Wouldn't it be better to use a collection of templateRegistry ?

admin.foo1:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [addTemplateRegistry, '@admin.foo.template_registry2']
       - [addTemplateRegistry, '@admin.foo.template_registry3']

admin.foo2:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [addTemplateRegistry, '@admin.foo.template_registry2']

admin.foo3:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [addTemplateRegistry, '@admin.foo.template_registry3']

@VincentLanglet VincentLanglet added this to the 4.0 milestone Nov 2, 2020
@phansys
Copy link
Member Author

phansys commented Nov 2, 2020

None of the proposed solutions (#6556, #6561) fix the issue, so until it is resolved, I must rollback the latest release I made in one of my projects, and declare a conflict against sonata-project/admin-bundle:>=3.76.0.

@wbloszyk
Copy link
Member

wbloszyk commented Nov 2, 2020

IMO keep this methods is bad decision. Templates should be manage by templates registry.

Why should it be ?
Creating a service to change the templates of multiple admins is not a bad idea.

IMO keep AbstractAdmin::setTemlate(s) is bad idea. Templates should be manage by template registry. This will keep model more clear.

But creating a service for changing one template seems over-engineered.

Agree. That why we should keep setTemplate(s) only in config. Compiler pass will delete calls for them and move call templates to TemplateRegistry argument. (hack)

But we can keep calling setters by catching this args, inject it by argument and remove and remove calling in compiler pass.

I'm not sure to fully understand. Do you want to auto-generate a templateRegistry if we provide setTemplate ?

TemplateRegistry can be create by user or will be auto-generated. In both way templates from setTemplate(s) will override TemplateRegistry argument.

Can you provide a way to have both this config

I can provide something like this:

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplateRegistry, '@admin.foo.template_registry'] # optional
       - [setTemplate, ['edit', 'admin/bar/edit.html.twig']] # this template will override templates from template registry

admin.foo.template_registry:
   class: Sonata\AdminBundle\Templating\MutableTemplatingRegistry # IMO this can be set by tag, then class will be optional
   tags: 
       - [name: "sonata.template_registry"]
   calls:
       - [setTemplate, ['show', 'admin/foo/show.html.twig']]
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]

Update for @VincentLanglet
I want add addTemplateRegistry to allow use multiple registry in 5.0 milestone.

@wbloszyk
Copy link
Member

wbloszyk commented Nov 2, 2020

None of the proposed solutions (#6556, #6561) fix the issue, so until it is resolved, I must rollback the latest release I made in one of my projects, and declare a conflict against sonata-project/admin-bundle:>=3.76.0.

@phansys I can fix in the evening if you agree with #6538 (comment)

@phansys
Copy link
Member Author

phansys commented Nov 2, 2020

@phansys I can fix in the evening if you agree with #6538 (comment)

I agree that it could be a working solution, but I'm in doubt since the template registry approach was not working in any of the related PRs yet.
Regarding the hack of removing the call to setTemplate() and setTemplates() in the admin service definition and passing them to the template registry service, I think we should chose a different name for these methods in the service calls to avoid confusions and make the situation a little bit clear. Maybe something like registerTemplate() or something that isn't a real method name in the admin class.

@VincentLanglet
Copy link
Member

But creating a service for changing one template seems over-engineered.

Agree. That why we should keep setTemplate(s) only in config. Compiler pass will delete calls for them and move call templates to TemplateRegistry argument. (hack)

Not sure if this hack will be natural for developer who won't understand why adding a setTemplate is allowed in calls when there is no setTemplate method in the AbstractAdmin class.

Regarding the hack of removing the call to setTemplate() and setTemplates() in the admin service definition and passing them to the template registry service, I think we should chose a different name for these methods in the service calls to avoid confusions and make the situation a little bit clear. Maybe something like registerTemplate() or something that isn't a real method name in the admin class.

I agree. Best would be a templates key in the config, but I assume it's not possible ?

Can you provide a way to have both this config

I can provide something like this:

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplateRegistry, '@admin.foo.template_registry'] # optional
       - [setTemplate, ['edit', 'admin/bar/edit.html.twig']] # this template will override templates from template registry

admin.foo.template_registry:
   class: Sonata\AdminBundle\Templating\MutableTemplatingRegistry # IMO this can be set by tag, then class will be optional
   tags: 
       - [name: "sonata.template_registry"]
   calls:
       - [setTemplate, ['show', 'admin/foo/show.html.twig']]
       - [setTemplate, ['edit', 'admin/foo/edit.html.twig']]

Seems great

Update for @VincentLanglet
I want add addTemplateRegistry to allow use multiple registry in 5.0 milestone.

Ok.

@phansys
Copy link
Member Author

phansys commented Nov 2, 2020

I agree. Best would be a templates key in the config, but I assume it's not possible ?

Maybe we could transmit the "magic" concept by using __templates as method name.

@wbloszyk
Copy link
Member

wbloszyk commented Nov 2, 2020

I agree. Best would be a templates key in the config, but I assume it's not possible ?

Maybe we could transmit the "magic" concept by using __templates as method name.

🤔

I found the best solution:
https://symfony.com/doc/current/service_container/tags.html#adding-additional-attributes-on-tags

We can use additional templates atributes on sonata.template_registry tag.

@VincentLanglet
Copy link
Member

We can use additional templates atributes on sonata.template_registry tag.

Can you give an example of the config you have in mind @wbloszyk ?

If it's on sonata.template_registry I'm not sure it resolve our concern about the AbstractAdmin::setTemplate method

admin.foo:
   class: App\FooAdmin
   arguments: [null, App\Entity\Foo, null]
   calls:
       - [setTemplate, ['edit', 'admin/bar/edit.html.twig']]

@wbloszyk
Copy link
Member

wbloszyk commented Nov 2, 2020

We can use additional templates atributes on sonata.template_registry tag.

Can you give an example of the config you have in mind @wbloszyk ?

If it's on sonata.template_registry I'm not sure it resolve our concern about the AbstractAdmin::setTemplate method

admin.foo:
    class: App\FooAdmin
        tags: 
            - [name: "sonata.template_registry", templates: ['edit': 'admin/bar/edit.html.twig', 'show': 'admin/bar/show.html.twig'] ]
        arguments: [null, App\Entity\Foo, null]

Of course in 3.x AbstractAdmin::templates property are used. In this case we have to set it by AbstractAdmin (in CompillerPass).

@VincentLanglet
Copy link
Member

admin.foo:
    class: App\FooAdmin
        tags: 
            - [name: "sonata.template_registry", templates: ['edit': 'admin/bar/edit.html.twig', 'show': 'admin/bar/show.html.twig'] ]
        arguments: [null, App\Entity\Foo, null]

Seems great.
Could you implement this @wbloszyk ?

With this, I think we don't have to revert the deprecation @phansys.

@phansys
Copy link
Member Author

phansys commented Nov 2, 2020

With this, I think we don't have to revert the deprecation @phansys.

Agreed.

@wbloszyk
Copy link
Member

wbloszyk commented Nov 2, 2020

Seems great.
Could you implement this @wbloszyk ?

I will try to do it today.

Additional this will add the same functionality to MutableTemplateRegistryAwereInterface.

@wbloszyk
Copy link
Member

wbloszyk commented Nov 4, 2020

Some update: #6566

  • tag attribute can not be array, I used virtual_template_method instead
  • I have some problem with current AddDependencyCallsCompilerPass:fixTemplates() but I found solution

Thursday is family day. I will finish it in Friday.

@kirya-dev
Copy link
Contributor

kirya-dev commented Nov 14, 2020

admin.foo:
    class: App\FooAdmin
        tags: 
            - [name: "sonata.template_registry", templates: ['edit': 'admin/bar/edit.html.twig', 'show': 'admin/bar/show.html.twig'] ]
        arguments: [null, App\Entity\Foo, null]

Seems great.

Could you implement this @wbloszyk ?

Me seams that its too complex to programming.
Configuring sonata admin job for very hard programmers?

@kirya-dev
Copy link
Contributor

kirya-dev commented Nov 14, 2020

What about configure templates in php code?

In FooBarAdmin::configure make something: (see symfony 5 way - zero yml configuration for new services)

<?php
declare(strict_types=1);

namespace App\Admin;

use App\Entity\FooBar;

class FooBarAdmin extends AbstractAdmin
{
    public function __construct()
    {
        parent::__construct('foo-bar', FooBar::class);
    }

    public function configure(): void
    {
        $this->getTemplateRegistry()->setTemplates([
            'list' => '@FooBar/list.html.twig',
        ]);
    }
}

@VincentLanglet
Copy link
Member

What about configure templates in php code?

In FooBarAdmin::configure make something: (see symfony 5 way - zero yml configuration for new services)

<?php
declare(strict_types=1);

namespace App\Admin;

use App\Entity\FooBar;

class FooBarAdmin extends AbstractAdmin
{
    public function __construct()
    {
        parent::__construct('foo-bar', FooBar::class);
    }

    public function configure(): void
    {
        $this->getTemplateRegistry()->setTemplates([
            'list' => '@FooBar/list.html.twig',
        ]);
    }
}

You can do it with configure indeed. But it's not bad to allow user to use yaml too.
Everybody will use his prefer way.

@kirya-dev
Copy link
Contributor

What about configure templates in php code?
In FooBarAdmin::configure make something: (see symfony 5 way - zero yml configuration for new services)

<?php
declare(strict_types=1);

namespace App\Admin;

use App\Entity\FooBar;

class FooBarAdmin extends AbstractAdmin
{
    public function __construct()
    {
        parent::__construct('foo-bar', FooBar::class);
    }

    public function configure(): void
    {
        $this->getTemplateRegistry()->setTemplates([
            'list' => '@FooBar/list.html.twig',
        ]);
    }
}

You can do it with configure indeed. But it's not bad to allow user to use yaml too.
Everybody will use his prefer way.

Its possible add my example to documentation?

@kirya-dev
Copy link
Contributor

kirya-dev commented Nov 17, 2020

Whyt ?

    protected function configureTemplateRegistry(MutableTemplateRegistryInterface $registry): void
    {
        $registry->setTemplate('edit', '@FooBar/FooBarAdmin/edit.html.twig');
    }

@kirya-dev
Copy link
Contributor

Also found problem: When call setTemplates() this fully discard previous (global) templates

@VincentLanglet
Copy link
Member

There is no real need to discuss about this PR before #6566

@phansys
Copy link
Member Author

phansys commented Dec 2, 2020

@wbloszyk, could I close this PR in favor of #6566? I think you can add the required documentation there.

@phansys phansys deleted the pr_6387 branch December 4, 2020 20:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants