DispatchingJinjaLoader
A loader that looks for templates in the application and all the blueprint folders.
Attributes
| Attribute | Type | Description |
|---|---|---|
| app | [App](../sansio/app/app.md?sid=flask_sansio_app_app) | The application instance used to access configuration settings and iterate through registered blueprints for template loading. |
Constructor
Signature
def DispatchingJinjaLoader(
app: [App](../sansio/app/app.md?sid=flask_sansio_app_app)
) - > None
Parameters
| Name | Type | Description |
|---|---|---|
| app | [App](../sansio/app/app.md?sid=flask_sansio_app_app) | The Flask application instance used to access configuration and loaders. |
Methods
get_source()
@classmethod
def get_source(
environment: BaseEnvironment,
template: str
) - > tuple[str, str | None, t.Callable[[], bool]| None]
Retrieves the template source code by dispatching the request to either a fast or an explained loading mechanism based on the application configuration.
Parameters
| Name | Type | Description |
|---|---|---|
| environment | BaseEnvironment | The Jinja environment instance requesting the template source. |
| template | str | The logical name or path of the template to be loaded. |
Returns
| Type | Description |
|---|---|
| `tuple[str, str | None, t.Callable[[], bool] |
list_templates()
@classmethod
def list_templates() - > list[str]
Aggregates and returns a unique list of all template names available across the application and all its blueprints.
Returns
| Type | Description |
|---|---|
list[str] | A list of unique template paths found in all active loaders. |