{
    "content": [
        {
            "type": "text",
            "text": "# Template::Plugins (perldoc)\n\n## NAME\n\nTemplate::Plugins - Plugin provider module\n\n## SYNOPSIS\n\nuse Template::Plugins;\n$pluginprovider = Template::Plugins->new(\\%options);\n($plugin, $error) = $pluginprovider->fetch($name, @args);\n\n## DESCRIPTION\n\nThe \"Template::Plugins\" module defines a provider class which can be used to load and\ninstantiate Template Toolkit plugin modules.\n\n## Sections\n\n- **NAME**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS**\n- **CONFIGURATION OPTIONS**\n- **TEMPLATE TOOLKIT PLUGINS**\n- **AUTHOR**\n- **COPYRIGHT**\n- **SEE ALSO**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Template::Plugins",
        "section": "",
        "mode": "perldoc",
        "summary": "Template::Plugins - Plugin provider module",
        "synopsis": "use Template::Plugins;\n$pluginprovider = Template::Plugins->new(\\%options);\n($plugin, $error) = $pluginprovider->fetch($name, @args);",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 6,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 44,
                "subsections": []
            },
            {
                "name": "CONFIGURATION OPTIONS",
                "lines": 56,
                "subsections": []
            },
            {
                "name": "TEMPLATE TOOLKIT PLUGINS",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "AUTHOR",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "COPYRIGHT",
                "lines": 5,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 2,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "Template::Plugins - Plugin provider module\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "use Template::Plugins;\n\n$pluginprovider = Template::Plugins->new(\\%options);\n\n($plugin, $error) = $pluginprovider->fetch($name, @args);\n",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The \"Template::Plugins\" module defines a provider class which can be used to load and\ninstantiate Template Toolkit plugin modules.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "new(\\%params)\nConstructor method which instantiates and returns a reference to a \"Template::Plugins\" object. A\nreference to a hash array of configuration items may be passed as a parameter. These are\ndescribed below.\n\nNote that the Template front-end module creates a \"Template::Plugins\" provider, passing all\nconfiguration items. Thus, the examples shown below in the form:\n\n$plugprov = Template::Plugins->new({\nPLUGINBASE => 'MyTemplate::Plugin',\nLOADPERL   => 1,\n...\n});\n\ncan also be used via the Template module as:\n\n$ttengine = Template->new({\nPLUGINBASE => 'MyTemplate::Plugin',\nLOADPERL   => 1,\n...\n});\n\nas well as the more explicit form of:\n\n$plugprov = Template::Plugins->new({\nPLUGINBASE => 'MyTemplate::Plugin',\nLOADPERL   => 1,\n...\n});\n\n$ttengine = Template->new({\nLOADPLUGINS => [ $plugprov ],\n});\n\nfetch($name, @args)\nCalled to request that a plugin of a given name be provided. The relevant module is first loaded\n(if necessary) and the load() class method called to return the factory class name (usually the\nsame package name) or a factory object (a prototype). The new() method is then called as a class\nor object method against the factory, passing all remaining parameters.\n\nReturns a reference to a new plugin object or \"($error, STATUSERROR)\" on error. May also return\n\"(undef, STATUSDECLINED)\" to decline to serve the request. If \"TOLERANT\" is set then all errors\nwill be returned as declines.\n",
                "subsections": []
            },
            "CONFIGURATION OPTIONS": {
                "content": "The following list summarises the configuration options that can be provided to the\n\"Template::Plugins\" new() constructor. Please consult Template::Manual::Config for further\ndetails and examples of each configuration option in use.\n\nPLUGINS\nThe PLUGINS option can be used to provide a reference to a hash array that maps plugin names to\nPerl module names.\n\nmy $plugins = Template::Plugins->new({\nPLUGINS => {\ncgi => 'MyOrg::Template::Plugin::CGI',\nfoo => 'MyOrg::Template::Plugin::Foo',\nbar => 'MyOrg::Template::Plugin::Bar',\n},\n});\n\nPLUGINBASE\nIf a plugin is not defined in the PLUGINS hash then the PLUGINBASE is used to attempt to\nconstruct a correct Perl module name which can be successfully loaded.\n\n# single value PLUGINBASE\nmy $plugins = Template::Plugins->new({\nPLUGINBASE => 'MyOrg::Template::Plugin',\n});\n\n# multiple value PLUGINBASE\nmy $plugins = Template::Plugins->new({\nPLUGINBASE => [   'MyOrg::Template::Plugin',\n'YourOrg::Template::Plugin'  ],\n});\n\nLOADPERL\nThe LOADPERL option can be set to allow you to load regular Perl modules (i.e. those that don't\nreside in the \"Template::Plugin\" or another user-defined namespace) as plugins.\n\nIf a plugin cannot be loaded using the PLUGINS or PLUGINBASE approaches then, if the LOADPERL\nis set, the provider will make a final attempt to load the module without prepending any prefix\nto the module path.\n\nUnlike regular plugins, modules loaded using LOADPERL do not receive a Template::Context\nreference as the first argument to the \"new()\" constructor method.\n\nTOLERANT\nThe TOLERANT flag can be set to indicate that the \"Template::Plugins\" module should ignore any\nerrors encountered while loading a plugin and instead return \"STATUSDECLINED\".\n\nDEBUG\nThe DEBUG option can be used to enable debugging messages for the \"Template::Plugins\" module by\nsetting it to include the \"DEBUGPLUGINS\" value.\n\nuse Template::Constants qw( :debug );\n\nmy $template = Template->new({\nDEBUG => DEBUGFILTERS | DEBUGPLUGINS,\n});\n",
                "subsections": []
            },
            "TEMPLATE TOOLKIT PLUGINS": {
                "content": "Please see Template::Manual::Plugins For a complete list of all the plugin modules distributed\nwith the Template Toolkit.\n",
                "subsections": []
            },
            "AUTHOR": {
                "content": "Andy Wardley <abw@wardley.org> <http://wardley.org/>\n",
                "subsections": []
            },
            "COPYRIGHT": {
                "content": "Copyright (C) 1996-2007 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::Plugins, Template::Plugin, Template::Context, Template.\n",
                "subsections": []
            }
        }
    }
}