mirror of
https://github.com/django-components/django-components.git
synced 2025-11-25 08:21:20 +00:00
Add component tag.
This commit is contained in:
parent
57286f8389
commit
9a91df7978
2 changed files with 13 additions and 0 deletions
|
|
@ -10,3 +10,9 @@ def component_dependencies_tag():
|
|||
out.append(component_class.render_dependencies())
|
||||
|
||||
return "\n".join(out)
|
||||
|
||||
@register.simple_tag(name="component")
|
||||
def component_tag(name, *args, **kwargs):
|
||||
component_class = registry._registry[name]
|
||||
component = component_class()
|
||||
return component.render(*args, **kwargs)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue