Skip to content
Myr

removed the notice about names in imported macros. that's documented as part of the import statement.

Before adoption: this commit came in with the history the project adopted, so no landing records it.

--HG-- branch : trunk

authored by Armin Ronacher · committed by Armin Ronacher · parent 1f627ff · Browse files · 1 file+0 added−7 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+0 added−7 removed

  • other:+0 added−7 removed

1 file+0 added−7 removed

modified:docs/templates.rst-7 removed
507 unmodified lines
508Macros are comparable with functions in regular programming languages. They509are useful to put often used idioms into reusable functions to not repeat510yourself.511512Macros can be defined in helper templates which then are :ref:`imported513<import>` or directly in the template where they are used. There is one big514difference between those two possibilities. A macro that is defined in the515template where it's also used has access to the context passed to the template.516A macro defined in another template and then imported can only access variables517defined there or in the global context.518512Here a small example of a macro that renders a form element::513514 {% macro input(name, value='', type='text', size=20) -%}515 <input type="{{ type }}" name="{{ name }}" value="{{
499 unmodified lines