Layout.template_modifier(modifier) in 2.9. How modifiers are displayed

How to return the previous functionality from version 2.8 ?

for md in ob.modifiers:
            box = layout.template_modifier(md)
            if box:
                # match enum type to our functions, avoids a lookup table.
                getattr(self, md.type)(box, ob, md)

This code doesn’t work because layout.template_modifier(md) no longer takes parameters. And changed to layout.template_modifiers() link to changes