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=src_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=src_flask_sansio_app_app)
) - > None
Parameters
| Name | Type | Description |
|---|---|---|
| app | [App](../sansio/app/app.md?sid=src_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 source code for a template by dispatching to either a fast or an explained loading strategy based on the application configuration.
Parameters
| Name | Type | Description |
|---|---|---|
| environment | BaseEnvironment | The Jinja environment instance requesting the template source. |
| template | str | The logical name 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 registered blueprints.
Returns
| Type | Description |
|---|---|
list[str] | A list of strings representing the available template paths. |