{
    "content": [
        {
            "type": "text",
            "text": "# Template::Filters (perldoc)\n\n## NAME\n\nTemplate::Filters - Post-processing filters for template blocks\n\n## SYNOPSIS\n\nuse Template::Filters;\n$filters = Template::Filters->new(\\%config);\n($filter, $error) = $filters->fetch($name, \\@args, $context);\nif ($filter) {\nprint &$filter(\"some text\");\n}\nelse {\nprint \"Could not fetch $name filter: $error\\n\";\n}\n\n## DESCRIPTION\n\nThe \"Template::Filters\" module implements a provider for creating subroutines that implement the\nstandard filters. Additional custom filters may be provided via the FILTERS configuration\noption.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS**\n- **CONFIGURATION OPTIONS**\n- **STANDARD FILTERS**\n- **AUTHOR**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Template::Filters",
        "section": "",
        "mode": "perldoc",
        "summary": "Template::Filters - Post-processing filters for template blocks",
        "synopsis": "use Template::Filters;\n$filters = Template::Filters->new(\\%config);\n($filter, $error) = $filters->fetch($name, \\@args, $context);\nif ($filter) {\nprint &$filter(\"some text\");\n}\nelse {\nprint \"Could not fetch $name filter: $error\\n\";\n}",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 13,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 58,
                "subsections": []
            },
            {
                "name": "CONFIGURATION OPTIONS",
                "lines": 30,
                "subsections": []
            },
            {
                "name": "STANDARD FILTERS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Template::Filters - Post-processing filters for template blocks\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Template::Filters;\n\n$filters = Template::Filters->new(\\%config);\n\n($filter, $error) = $filters->fetch($name, \\@args, $context);\n\nif ($filter) {\nprint &$filter(\"some text\");\n}\nelse {\nprint \"Could not fetch $name filter: $error\\n\";\n}\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The \"Template::Filters\" module implements a provider for creating subroutines that implement the\nstandard filters. Additional custom filters may be provided via the FILTERS configuration\noption.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "new(\\%params)\nConstructor method which instantiates and returns a reference to a \"Template::Filters\" object. A\nreference to a hash array of configuration items may be passed as a parameter. These are\ndescribed below.\n\nmy $filters = Template::Filters->new({\nFILTERS => { ... },\n});\n\nmy $template = Template->new({\nLOADFILTERS => [ $filters ],\n});\n\nA default \"Template::Filters\" module is created by the Template module if the LOADFILTERS\noption isn't specified. All configuration parameters are forwarded to the constructor.\n\n$template = Template->new({\nFILTERS => { ... },\n});\n\nfetch($name, \\@args, $context)\nCalled to request that a filter of a given name be provided. The name of the filter should be\nspecified as the first parameter. This should be one of the standard filters or one specified in\nthe FILTERS configuration hash. The second argument should be a reference to an array containing\nconfiguration parameters for the filter. This may be specified as 0, or undef where no\nparameters are provided. The third argument should be a reference to the current\nTemplate::Context object.\n\nThe method returns a reference to a filter sub-routine on success. It may also return \"(undef,\nSTATUSDECLINE)\" to decline the request, to allow delegation onto other filter providers in the\nLOADFILTERS chain of responsibility. On error, \"($error, STATUSERROR)\" is returned where\n$error is an error message or Template::Exception object indicating the error that occurred.\n\nWhen the \"TOLERANT\" option is set, errors are automatically downgraded to a \"STATUSDECLINE\"\nresponse.\n\nusehtmlentities()\nThis class method can be called to configure the \"htmlentity\" filter to use the HTML::Entities\nmodule. An error will be raised if it is not installed on your system.\n\nuse Template::Filters;\nTemplate::Filters->usehtmlentities();\n\nuseapacheutil()\nThis class method can be called to configure the \"htmlentity\" filter to use the Apache::Util\nmodule. An error will be raised if it is not installed on your system.\n\nuse Template::Filters;\nTemplate::Filters->useapacheutil();\n\nuserfc2732()\nThis class method can be called to configure the \"uri\" and \"url\" filters to use the older\nRFC2732 standard for matching unsafe characters.\n\nuserfc3986()\nThis class method can be called to configure the \"uri\" and \"url\" filters to use the newer\nRFC3986 standard for matching unsafe characters.\n",
                "subsections": []
            },
            "CONFIGURATION OPTIONS": {
                "content": "The following list summarises the configuration options that can be provided to the\n\"Template::Filters\" new() constructor. Please see Template::Manual::Config for further\ninformation about each option.\n\nFILTERS\nThe FILTERS option can be used to specify custom filters which can then be used with the FILTER\ndirective like any other. These are added to the standard filters which are available by\ndefault.\n\n$filters = Template::Filters->new({\nFILTERS => {\n'sfilt1' =>   \\&staticfilter,\n'dfilt1' => [ \\&dyanamicfilterfactory, 1 ],\n},\n});\n\nTOLERANT\nThe TOLERANT flag can be set to indicate that the \"Template::Filters\" module should ignore any\nerrors and instead return \"STATUSDECLINED\".\n\nDEBUG\nThe DEBUG option can be used to enable debugging messages for the Template::Filters module by\nsetting it to include the \"DEBUGFILTERS\" value.\n\nuse Template::Constants qw( :debug );\n\nmy $template = Template->new({\nDEBUG => DEBUGFILTERS | DEBUGPLUGINS,\n});\n",
                "subsections": []
            },
            "STANDARD FILTERS": {
                "content": "Please see Template::Manual::Filters for a list of the filters provided with the Template\nToolkit, complete with examples of use.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Andy Wardley <abw@wardley.org> <http://wardley.org/>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (C) 1996-2014 Andy Wardley. All Rights Reserved.\n\nThis module is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "Template::Manual::Filters, Template, Template::Context\n",
                "subsections": []
            }
        }
    }
}