Permalink
Find file
Fetching contributors…
Cannot retrieve contributors at this time
1787 lines (1303 sloc) 76.3 KB
<!doctype html public "✰">
<!--[if lt IE 7]> <html lang="en-us" class="no-js ie6"> <![endif]-->
<!--[if IE 7]> <html lang="en-us" class="no-js ie7"> <![endif]-->
<!--[if IE 8]> <html lang="en-us" class="no-js ie8"> <![endif]-->
<!--[if IE 9]> <html lang="en-us" class="no-js ie9"> <![endif]-->
<!--[if gt IE 9]><!--> <html lang="en-us" class="no-js"> <!--<![endif]-->
<head>
<meta charset="utf-8">
<title>Perl Doc Viewer</title>
<meta http-equiv="X-UA-Compatible" content="IE=Edge;chrome=1" >
<meta http-equiv="imagetoolbar" content="false">
<meta name="description" content="Perl Doc Viewer">
<!-- Base Styles -->
<link href="/css/bootstrap.min.css" rel="stylesheet">
<link href="/css/style.css" rel="stylesheet">
<link href="/css/hashgrid.css" rel="stylesheet">
<link href="/css/github.css" rel="stylesheet">
<!-- favicon and touch icons -->
<link rel="shortcut icon" href="/img/favicon.ico">
<link rel="apple-touch-icon" href="/img/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" href="/img/apple-touch-icon-72x72.png" sizes="72x72">
<link rel="apple-touch-icon" href="/img/apple-touch-icon-114x114.png" sizes="114x114">
</head>
<body data-spy="scroll" data-offset="21">
<div id="sidebar">
<ul class="nav nav-list accordion-group">
<li class="section-filter">
<input type="text" class="search-query" placeholder="Search Table of Contents">
</li>
<li class="divider"></li>
<li><a href="#" class="nav-header" data-toggle="collapse" data-target=".search-results" data-parent="#sidebar">Search Results</a></li>
<ul class="search-results nav nav-list collapse in">
<li><a href="#moose">
<p>:m<b>oo</b>se</p>
<small>This will export everything except functions which clash with Moose. Currently these are.</small>
</a></li>
<li><a href="#syntax">
<p>:syntax</p>
<small>Dancer::Config::Object - <i>no description</i></small>
</a></li>
<li><a href="#NAME">
<p>cookie</p>
<small>Accesses a cookie value (or sets it). Note that this method will eventually be preferred over.</small>
</a></li>
</ul>
<li class="divider"></li>
<li><a href="#" class="nav-header" data-toggle="collapse" data-target="#Dancer" data-parent="#sidebar">Dancer</a></li>
<ul id="Dancer" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
<li><a href="#MORE-DOCUMENTATION">MORE DOCUMENTATION</a></li>
<li><a href="#EXPORTS">EXPORTS</a>
<ul id="MORE-DOCUMENTATION-NAV" class="nav nav-list collapse in">
<li><a href="#moose">:moose</a></li>
<li><a href="#syntax">:syntax</a></li>
<li><a href="#tests">:tests</a></li>
<li><a href="#script">:script</a></li>
<li><a href="#keyword">!keyword</a></li>
</ul>
</li>
<li><a href="#FUNCTIONS">FUNCTIONS</a>
<ul class="nav nav-list">
<li><a href="#after">after</a></li>
<li><a href="#any">any</a></li>
<li><a href="#before">before</a></li>
<li><a href="#before_template">before_template</a></li>
<li><a href="#cookies">cookies</a></li>
<li><a href="#cookie">cookie</a></li>
<li><a href="#config">config</a></li>
<li><a href="#content_type">content_type</a></li>
<li><a href="#dance">dance</a></li>
<li><a href="#debug">debug</a></li>
<li><a href="#dirname">dirname</a></li>
<li><a href="#engine">engine</a></li>
<li><a href="#error">error</a></li>
<li><a href="#false">false</a></li>
<li><a href="#forward">forward</a></li>
<li><a href="#from_dumper-structure-">from_dumper ($structure)</a></li>
<li><a href="#from_json-structure-options-">from_json ($structure, %options)</a></li>
<li><a href="#from_yaml-structure-">from_yaml ($structure)</a></li>
<li><a href="#from_xml-structure-options-">from_xml ($structure, %options)</a></li>
<li><a href="#get">get</a></li>
<li><a href="#halt">halt</a></li>
<li><a href="#headers">headers</a></li>
<li><a href="#header">header</a></li>
<li><a href="#push_header">push_header</a></li>
<li><a href="#hook">hook</a></li>
<li><a href="#info">info</a></li>
<li><a href="#layout">layout</a></li>
<li><a href="#logger">logger</a></li>
<li><a href="#load">load</a></li>
<li><a href="#load_app">load_app</a></li>
<li><a href="#mime">mime</a></li>
<li><a href="#params">params</a></li>
<li><a href="#param">param</a></li>
<li><a href="#pass">pass</a></li>
<li><a href="#patch">patch</a></li>
<li><a href="#path">path</a></li>
<li><a href="#post">post</a></li>
<li><a href="#prefix">prefix</a></li>
<li><a href="#del">del</a></li>
<li><a href="#options">options</a></li>
<li><a href="#put">put</a></li>
<li><a href="#redirect">redirect</a></li>
<li><a href="#render_with_layout">render_with_layout</a></li>
<li><a href="#request">request</a></li>
<li><a href="#send_error">send_error</a></li>
<li><a href="#send_file">send_file</a></li>
<li><a href="#set">set</a></li>
<li><a href="#setting">setting</a></li>
<li><a href="#set_cookie">set_cookie</a></li>
<li><a href="#session">session</a></li>
<li><a href="#splat">splat</a></li>
<li><a href="#start">start</a></li>
<li><a href="#status">status</a></li>
<li><a href="#template">template</a></li>
<li><a href="#to_dumper-structure-">to_dumper ($structure)</a></li>
<li><a href="#to_json-structure-options-">to_json ($structure, %options)</a></li>
<li><a href="#to_yaml-structure-">to_yaml ($structure)</a></li>
<li><a href="#to_xml-structure-options-">to_xml ($structure, %options)</a></li>
<li><a href="#true">true</a></li>
<li><a href="#upload">upload</a></li>
<li><a href="#uri_for">uri_for</a></li>
<li><a href="#captures">captures</a></li>
<li><a href="#var">var</a></li>
<li><a href="#vars">vars</a></li>
<li><a href="#warning">warning</a></li>
</ul>
</li>
<li><a href="#AUTHOR">AUTHOR</a></li>
<li><a href="#SOURCE-CODE">SOURCE CODE</a></li>
<li><a href="#GETTING-HELP-CONTRIBUTING">GETTING HELP / CONTRIBUTING</a></li>
<li><a href="#DEPENDENCIES">DEPENDENCIES</a></li>
<li><a href="#LICENSE">LICENSE</a></li>
<li><a href="#SEE-ALSO">SEE ALSO</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-target="#Dancer_Config" data-parent="#sidebar">Dancer::Config</a></li>
<ul id="Dancer_Config" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-target="#Dancer_Config_Object" data-parent="#sidebar">Dancer::Config::Object</a></li>
<ul id="Dancer_Config_Object" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Cookie">Dancer::Cookie</a></li>
<ul id="Dancer_Cookie" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Cookies">Dancer::Cookies</a></li>
<ul id="Dancer_Cookies" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Deprecation">Dancer::Deprecation</a></li>
<ul id="Dancer_Deprecation" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Engine">Dancer::Engine</a></li>
<ul id="Dancer_Engine" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Error">Dancer::Error</a></li>
<ul id="Dancer_Error" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Exception">Dancer::Exception</a></li>
<ul id="Dancer_Exception" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Exception_Base">Dancer::Exception::Base</a></li>
<ul id="Dancer_Exception_Base" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_FileUtils">Dancer::FileUtils</a></li>
<ul id="Dancer_FileUtils" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_HTTP">Dancer::HTTP</a></li>
<ul id="Dancer_HTTP" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Handler_Debug">Dancer::Handler::Debug</a></li>
<ul id="Dancer_Handler_Debug" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Handler_PSGI">Dancer::Handler::PSGI</a></li>
<ul id="Dancer_Handler_PSGI" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Hook">Dancer::Hook</a></li>
<ul id="Dancer_Hook" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Hook_Properties">Dancer::Hook::Properties</a></li>
<ul id="Dancer_Hook_Properties" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Logger">Dancer::Logger</a></li>
<ul id="Dancer_Logger" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Logger_Abstract">Dancer::Logger::Abstract</a></li>
<ul id="Dancer_Logger_Abstract" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Logger_Capture">Dancer::Logger::Capture</a></li>
<ul id="Dancer_Logger_Capture" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Logger_Capture_Trap">Dancer::Logger::Capture::Trap</a></li>
<ul id="Dancer_Logger_Capture_Trap" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Logger_Console">Dancer::Logger::Console</a></li>
<ul id="Dancer_Logger_Console" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Logger_Diag">Dancer::Logger::Diag</a></li>
<ul id="Dancer_Logger_Diag" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Logger_File">Dancer::Logger::File</a></li>
<ul id="Dancer_Logger_File" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Logger_Note">Dancer::Logger::Note</a></li>
<ul id="Dancer_Logger_Note" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Logger_Null">Dancer::Logger::Null</a></li>
<ul id="Dancer_Logger_Null" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_MIME">Dancer::MIME</a></li>
<ul id="Dancer_MIME" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_ModuleLoader">Dancer::ModuleLoader</a></li>
<ul id="Dancer_ModuleLoader" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Object">Dancer::Object</a></li>
<ul id="Dancer_Object" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Object_Singleton">Dancer::Object::Singleton</a></li>
<ul id="Dancer_Object_Singleton" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Plugin">Dancer::Plugin</a></li>
<ul id="Dancer_Plugin" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Plugin_Ajax">Dancer::Plugin::Ajax</a></li>
<ul id="Dancer_Plugin_Ajax" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Request">Dancer::Request</a></li>
<ul id="Dancer_Request" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Request_Upload">Dancer::Request::Upload</a></li>
<ul id="Dancer_Request_Upload" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Response">Dancer::Response</a></li>
<ul id="Dancer_Response" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Route_Cache">Dancer::Route::Cache</a></li>
<ul id="Dancer_Route_Cache" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Serializer">Dancer::Serializer</a></li>
<ul id="Dancer_Serializer" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Serializer_JSON">Dancer::Serializer::JSON</a></li>
<ul id="Dancer_Serializer_JSON" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Serializer_Mutable">Dancer::Serializer::Mutable</a></li>
<ul id="Dancer_Serializer_Mutable" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Serializer_XML">Dancer::Serializer::XML</a></li>
<ul id="Dancer_Serializer_XML" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Serializer_YAML">Dancer::Serializer::YAML</a></li>
<ul id="Dancer_Serializer_YAML" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Session">Dancer::Session</a></li>
<ul id="Dancer_Session" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Session_Abstract">Dancer::Session::Abstract</a></li>
<ul id="Dancer_Session_Abstract" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Session_Simple">Dancer::Session::Simple</a></li>
<ul id="Dancer_Session_Simple" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Session_YAML">Dancer::Session::YAML</a></li>
<ul id="Dancer_Session_YAML" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Template">Dancer::Template</a></li>
<ul id="Dancer_Template" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Template_Abstract">Dancer::Template::Abstract</a></li>
<ul id="Dancer_Template_Abstract" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Template_Simple">Dancer::Template::Simple</a></li>
<ul id="Dancer_Template_Simple" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Template_TemplateToolkit">Dancer::Template::TemplateToolkit</a></li>
<ul id="Dancer_Template_TemplateToolkit" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Test">Dancer::Test</a></li>
<ul id="Dancer_Test" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
<li><a href="#" class="nav-header" data-toggle="collapse" data-parent="#sidebar" data-target="#Dancer_Timer">Dancer::Timer</a></li>
<ul id="Dancer_Timer" class="collapse nav nav-list">
<li><a href="#NAME">NAME</a></li>
<li><a href="#SYNOPSIS">SYNOPSIS</a></li>
<li><a href="#DESCRIPTION">DESCRIPTION</a></li>
</ul>
</ul>
</div>
<div id="content">
<div class="subhead">
<h1>Dancer</h1>
<p>Lightweight, yet powerful web application framework</p>
</div>
<h1 id="NAME">NAME</h1>
<p>Dancer - lightweight yet powerful web application framework</p>
<h1 id="SYNOPSIS">SYNOPSIS</h1>
<pre><code> #!/usr/bin/perl
use Dancer;
get &#39;/hello/:name&#39; =&gt; sub {
return &quot;Why, hello there &quot; . param(&#39;name&#39;);
};
dance;</code></pre>
<p>The above is a basic but functional web app created with Dancer. If you want to see more examples and get up and running quickly, check out the <a href="/module/Dancer::Introduction">Dancer::Introduction</a> and the <a href="/module/Dancer::Cookbook">Dancer::Cookbook</a>. For examples on deploying your Dancer applications, see <a href="/module/Dancer::Deployment">Dancer::Deployment</a>.</p>
<h1 id="DESCRIPTION">DESCRIPTION</h1>
<p>Dancer is a web application framework designed to be as effortless as possible for the developer, taking care of the boring bits as easily as possible, yet staying out of your way and letting you get on with writing your code.</p>
<p>Dancer aims to provide the simplest way for writing web applications, and offers the flexibility to scale between a very simple lightweight web service consisting of a few lines of code in a single file, all the way up to a more complex fully-fledged web application with session support, templates for views and layouts, etc.</p>
<p>If you don&#39;t want to write CGI scripts by hand, and find Catalyst too big or cumbersome for your project, Dancer is what you need.</p>
<p>Dancer has few pre-requisites, so your Dancer webapps will be easy to deploy.</p>
<p>Dancer apps can be used with a an embedded web server (great for easy testing), and can run under PSGI/Plack for easy deployment in a variety of webserver environments.</p>
<h1 id="MORE-DOCUMENTATION">MORE DOCUMENTATION</h1>
<p>This documentation describes all the exported symbols of Dancer. If you want a quick start guide to discover the framework, you should look at <a href="/module/Dancer::Introduction">Dancer::Introduction</a>, or <a href="/module/Dancer::Tutorial">Dancer::Tutorial</a> to learn by example.</p>
<p>If you want to have specific examples of code for real-life problems, see the <a href="/module/Dancer::Cookbook">Dancer::Cookbook</a>.</p>
<p>If you want to see configuration examples of different deployment solutions involving Dancer and Plack, see <a href="/module/Dancer::Deployment">Dancer::Deployment</a>.</p>
<p>You can find out more about the many useful plugins available for Dancer in <a href="/module/Dancer::Plugins">Dancer::Plugins</a>.</p>
<h1 id="EXPORTS">EXPORTS</h1>
<p>By default, <code>use Dancer</code> exports all the functions below plus sets up your app. You can control the exporting through the normal <a href="/module/Exporter">Exporter</a> mechanism. For example:</p>
<pre><code> # Just export the route controllers
use Dancer qw(get post put patch del);
# Export everything but pass to avoid clashing with Test::More
use Test::More;
use Dancer qw(!pass);</code></pre>
<p>There are also some special tags to control exports and behaviour.</p>
<h2 id="moose">:moose</h2>
<p>This will export everything except functions which clash with Moose. Currently these are <code>after</code> and <code>before</code>.</p>
<h2 id="syntax">:syntax</h2>
<p>This tells Dancer to just export symbols and not set up your app. This is most useful for writing Dancer code outside of your main route handler.</p>
<h2 id="tests">:tests</h2>
<p>This will export everything except functions which clash with commonly used testing modules. Currently these are <code>pass</code>.</p>
<p>It can be combined with other export pragmas. For example, while testing...</p>
<pre><code> use Test::More;
use Dancer qw(:syntax :tests);
# Test::Most also exports &quot;set&quot; and &quot;any&quot;
use Test::Most;
use Dancer qw(:syntax :tests !set !any);
# Alternatively, if you want to use Dancer&#39;s set and any...
use Test::Most qw(!set !any);
use Dancer qw(:syntax :tests);</code></pre>
<h2 id="script">:script</h2>
<p>This will export all the keywords, and will also load the configuration.</p>
<p>This is useful when you want to use your Dancer application from a script.</p>
<pre><code> use MyApp;
use Dancer &#39;:script&#39;;
MyApp::schema(&#39;DBSchema&#39;)-&gt;deploy();</code></pre>
<p>By default, the <a href="/module/warnings">warnings</a> pragma will also be exported, meaning your app/script will be running under <code>use warnings</code>. If you do not want this, set the <a href="/module/Dancer::Config#import_warnings">import_warnings</a> setting to a false value.</p>
<h2 id="keyword">!keyword</h2>
<p>If you want to simply prevent Dancer from exporting specific keywords (perhaps you plan to implement them yourself in a different way, or you don&#39;t plan to use them and they clash with another module you&#39;re loading), you can simply exclude them:</p>
<pre><code> use Dancer qw(!session);</code></pre>
<p>The above would import all keywords as normal, with the exception of <code>session</code>.</p>
<h1 id="FUNCTIONS">FUNCTIONS</h1>
<h2 id="after">after</h2>
<p>Deprecated - see the <code>after</code> <a href="/module/Dancer#hook">hook</a>.</p>
<h2 id="any">any</h2>
<p>Defines a route for multiple HTTP methods at once:</p>
<pre><code> any [&#39;get&#39;, &#39;post&#39;] =&gt; &#39;/myaction&#39; =&gt; sub {
# code
};</code></pre>
<p>Or even, a route handler that would match any HTTP methods:</p>
<pre><code> any &#39;/myaction&#39; =&gt; sub {
# code
};</code></pre>
<h2 id="before">before</h2>
<p>Deprecated - see the <code>before</code> <a href="/module/Dancer#hook">hook</a>.</p>
<h2 id="before_template">before_template</h2>
<p>Deprecated - see the <code>before_template</code> <a href="/module/Dancer#hook">hook</a>.</p>
<h2 id="cookies">cookies</h2>
<p>Accesses cookies values, it returns a HashRef of <a href="/module/Dancer::Cookie">Dancer::Cookie</a> objects:</p>
<pre><code> get &#39;/some_action&#39; =&gt; sub {
my $cookie = cookies-&gt;{name};
return $cookie-&gt;value;
};</code></pre>
<p>In the case you have stored something else than a Scalar in your cookie:</p>
<pre><code> get &#39;/some_action&#39; =&gt; sub {
my $cookie = cookies-&gt;{oauth};
my %values = $cookie-&gt;value;
return ($values{token}, $values{token_secret});
};</code></pre>
<h2 id="cookie">cookie</h2>
<p>Accesses a cookie value (or sets it). Note that this method will eventually be preferred over <code>set_cookie</code>.</p>
<pre><code> cookie lang =&gt; &quot;fr-FR&quot;; # set a cookie and return its value
cookie lang =&gt; &quot;fr-FR&quot;, expires =&gt; &quot;2 hours&quot;; # extra cookie info
cookie &quot;lang&quot; # return a cookie value</code></pre>
<p>If your cookie value is a key/value URI string, like</p>
<pre><code> token=ABC&amp;user=foo</code></pre>
<p><code>cookie</code> will only return the first part (<code>token=ABC</code>) if called in scalar context. Use list context to fetch them all:</p>
<pre><code> my @values = cookie &quot;name&quot;;</code></pre>
<h2 id="config">config</h2>
<p>Accesses the configuration of the application:</p>
<pre><code> get &#39;/appname&#39; =&gt; sub {
return &quot;This is &quot; . config-&gt;{appname};
};</code></pre>
<h2 id="content_type">content_type</h2>
<p>Sets the <b>content-type</b> rendered, for the current route handler:</p>
<pre><code> get &#39;/cat/:txtfile&#39; =&gt; sub {
content_type &#39;text/plain&#39;;
# here we can dump the contents of param(&#39;txtfile&#39;)
};</code></pre>
<p>You can use abbreviations for content types. For instance:</p>
<pre><code> get &#39;/svg/:id&#39; =&gt; sub {
content_type &#39;svg&#39;;
# here we can dump the image with id param(&#39;id&#39;)
};</code></pre>
<p>Note that if you want to change the default content-type for every route, you have to change the <code>content_type</code> setting instead.</p>
<h2 id="dance">dance</h2>
<p>Alias for the <code>start</code> keyword.</p>
<h2 id="debug">debug</h2>
<p>Logs a message of debug level:</p>
<pre><code> debug &quot;This is a debug message&quot;;
</code></pre>
<p>See <a href="/module/Dancer::Logger">Dancer::Logger</a> for details on how to configure where log messages go.</p>
<h2 id="dirname">dirname</h2>
<p>Returns the dirname of the path given:</p>
<pre><code> my $dir = dirname($some_path);</code></pre>
<h2 id="engine">engine</h2>
<p>Given a namespace, returns the current engine object</p>
<pre><code> my $template_engine = engine &#39;template&#39;;
my $html = $template_engine-&gt;apply_renderer(...);
$template_engine-&gt;apply_layout($html);</code></pre>
<h2 id="error">error</h2>
<p>Logs a message of error level:</p>
<pre><code> error &quot;This is an error message&quot;;</code></pre>
<p>See <a href="/module/Dancer::Logger">Dancer::Logger</a> for details on how to configure where log messages go.</p>
<h2 id="false">false</h2>
<p>Constant that returns a false value (0).</p>
<h2 id="forward">forward</h2>
<p>Runs an internal redirect of the current request to another request. This helps you avoid having to redirect the user using HTTP and set another request to your application.</p>
<p>It effectively lets you chain routes together in a clean manner.</p>
<pre><code> get &#39;/demo/articles/:article_id&#39; =&gt; sub {
# you&#39;ll have to implement this next sub yourself :)
change_the_main_database_to_demo();
forward &quot;/articles/&quot; . params-&gt;{article_id};
};</code></pre>
<p>In the above example, the users that reach <i>/demo/articles/30</i> will actually reach <i>/articles/30</i> but we&#39;ve changed the database to demo before.</p>
<p>This is pretty cool because it lets us retain our paths and offer a demo database by merely going to <i>/demo/...</i>.</p>
<p>You&#39;ll notice that in the example we didn&#39;t indicate whether it was <b>GET</b> or <b>POST</b>. That is because <code>forward</code> chains the same type of route the user reached. If it was a <b>GET</b>, it will remain a <b>GET</b> (but if you do need to change the method, you can do so; read on below for details.)</p>
<p><b>WARNING</b> : Issuing a forward immediately exits the current route, and perform the forward. Thus, any code after a forward is ignored, until the end of the route. e.g.</p>
<pre><code> get &#39;/foo/:article_id&#39; =&gt; sub {
if ($condition) {
forward &quot;/articles/&quot; . params-&gt;{article_id};
# The following code is never executed
do_stuff();
}
more_stuff();
};</code></pre>
<p>So it&#39;s not necessary anymore to use <code>return</code> with forward.</p>
<p>Note that forward doesn&#39;t parse GET arguments. So, you can&#39;t use something like:</p>
<pre><code> return forward &#39;/home?authorized=1&#39;;</code></pre>
<p>But <code>forward</code> supports an optional HashRef with parameters to be added to the actual parameters:</p>
<pre><code> return forward &#39;/home&#39;, { authorized =&gt; 1 };</code></pre>
<p>Finally, you can add some more options to the forward method, in a third argument, also as a HashRef. That option is currently only used to change the method of your request. Use with caution.</p>
<pre><code> return forward &#39;/home&#39;, { auth =&gt; 1 }, { method =&gt; &#39;POST&#39; };</code></pre>
<h2 id="from_dumper-structure-">from_dumper ($structure)</h2>
<p>Deserializes a Data::Dumper structure.</p>
<h2 id="from_json-structure-options-">from_json ($structure, %options)</h2>
<p>Deserializes a JSON structure. Can receive optional arguments. Those arguments are valid <a href="/module/JSON">JSON</a> arguments to change the behaviour of the default <code>JSON::from_json</code> function.</p>
<h2 id="from_yaml-structure-">from_yaml ($structure)</h2>
<p>Deserializes a YAML structure.</p>
<h2 id="from_xml-structure-options-">from_xml ($structure, %options)</h2>
<p>Deserializes a XML structure. Can receive optional arguments. These arguments are valid <a href="/module/XML::Simple">XML::Simple</a> arguments to change the behaviour of the default <code>XML::Simple::XMLin</code> function.</p>
<h2 id="get">get</h2>
<p>Defines a route for HTTP <b>GET</b> requests to the given path:</p>
<pre><code> get &#39;/&#39; =&gt; sub {
return &quot;Hello world&quot;;
}</code></pre>
<p>Note that a route to match <b>HEAD</b> requests is automatically created as well.</p>
<h2 id="halt">halt</h2>
<p>Sets a response object with the content given.</p>
<p>When used as a return value from a filter, this breaks the execution flow and renders the response immediately:</p>
<pre><code> before sub {
if ($some_condition) {
halt(&quot;Unauthorized&quot;);
# This code is not executed :
do_stuff();
}
};
get &#39;/&#39; =&gt; sub {
&quot;hello there&quot;;
};</code></pre>
<p><b>WARNING</b> : Issuing a halt immediately exits the current route, and perform the halt. Thus, any code after a halt is ignored, until the end of the route. So it&#39;s not necessary anymore to use <code>return</code> with halt.</p>
<h2 id="headers">headers</h2>
<p>Adds custom headers to responses:</p>
<pre><code> get &#39;/send/headers&#39;, sub {
headers &#39;X-Foo&#39; =&gt; &#39;bar&#39;, X-Bar =&gt; &#39;foo&#39;;
}</code></pre>
<h2 id="header">header</h2>
<p>adds a custom header to response:</p>
<pre><code> get &#39;/send/header&#39;, sub {
header &#39;x-my-header&#39; =&gt; &#39;shazam!&#39;;
}</code></pre>
<p>Note that it will overwrite the old value of the header, if any. To avoid that, see <a href="#push_header">&quot;push_header&quot;</a>.</p>
<h2 id="push_header">push_header</h2>
<p>Do the same as <code>header</code>, but allow for multiple headers with the same name.</p>
<pre><code> get &#39;/send/header&#39;, sub {
push_header &#39;x-my-header&#39; =&gt; &#39;1&#39;;
push_header &#39;x-my-header&#39; =&gt; &#39;2&#39;;
will result in two headers &quot;x-my-header&quot; in the response
}</code></pre>
<h2 id="hook">hook</h2>
<p>Adds a hook at some position. For example :</p>
<pre><code> hook before_serializer =&gt; sub {
my $response = shift;
$response-&gt;content-&gt;{generated_at} = localtime();
};</code></pre>
<p>There can be multiple hooks assigned to a given position, and each will be executed in order.</p>
<p>(For details on how to register new hooks from within plugins, see <a href="/module/Dancer::Hook">Dancer::Hook</a>.) Supported <b>before</b> hooks (in order of execution):</p>
<dl>
<dt id="before_deserializer">before_deserializer</dt>
<dd>
<p>This hook receives no arguments.</p>
<pre><code> hook before_deserializer =&gt; sub {
...
};</code></pre>
</dd>
<dt id="before_file_render">before_file_render</dt>
<dd>
<p>This hook receives as argument the path of the file to render.</p>
<pre><code> hook before_file_render =&gt; sub {
my $path = shift;
...
};</code></pre>
</dd>
<dt id="before_error_init">before_error_init</dt>
<dd>
<p>This hook receives as argument a <a href="/module/Dancer::Error">Dancer::Error</a> object.</p>
<pre><code> hook before_error_init =&gt; sub {
my $error = shift;
...
};</code></pre>
</dd>
<dt id="before_error_render">before_error_render</dt>
<dd>
<p>This hook receives as argument a <a href="/module/Dancer::Error">Dancer::Error</a> object.</p>
<pre><code> hook before_error_render =&gt; sub {
my $error = shift;
};</code></pre>
</dd>
<dt id="before1">before</dt>
<dd>
<p>This hook receives one argument, a reference to the subroutine that implements the route that is being intercepted by this hook.</p>
<pre><code> hook before =&gt; sub {
my $route_handler = shift;
...
};</code></pre>
<p>it is equivalent to the deprecated</p>
<pre><code> before sub {
...
};</code></pre>
</dd>
<dt id="before_template_render">before_template_render</dt>
<dd>
<p>This is an alias to &#39;before_template&#39;.</p>
<p>This hook receives as argument a HashRef, containing the tokens that will be passed to the template. You can use it to add more tokens, or delete some specific token.</p>
<pre><code> hook before_template_render =&gt; sub {
my $tokens = shift;
delete $tokens-&gt;{user};
$tokens-&gt;{time} = localtime;
};</code></pre>
<p>is equivalent to</p>
<pre><code> hook before_template =&gt; sub {
my $tokens = shift;
delete $tokens-&gt;{user};
$tokens-&gt;{time} = localtime;
};</code></pre>
</dd>
<dt id="before_layout_render">before_layout_render</dt>
<dd>
<p>This hook receives two arguments. The first one is a HashRef containing the tokens. The second is a ScalarRef representing the content of the template.</p>
<pre><code> hook before_layout_render =&gt; sub {
my ($tokens, $html_ref) = @_;
...
};</code></pre>
</dd>
<dt id="before_serializer">before_serializer</dt>
<dd>
<p>This hook receives as argument a <a href="/module/Dancer::Response">Dancer::Response</a> object.</p>
<pre><code> hook before_serializer =&gt; sub {
my $response = shift;
$response-&gt;content-&gt;{start_time} = time();
};</code></pre>
</dd>
</dl>
<p>Supported <b>after</b> hooks (in order of execution):</p>
<dl>
<dt id="after_deserializer">after_deserializer</dt>
<dd>
<p>This hook receives no arguments.</p>
<pre><code> hook after_deserializer =&gt; sub {
...
};</code></pre>
</dd>
<dt id="after_file_render">after_file_render</dt>
<dd>
<p>This hook receives as argument a <a href="/module/Dancer::Response">Dancer::Response</a> object.</p>
<pre><code> hook after_file_render =&gt; sub {
my $response = shift;
};</code></pre>
</dd>
<dt id="after_template_render">after_template_render</dt>
<dd>
<p>This hook receives as argument a ScalarRef representing the content generated by the template.</p>
<pre><code> hook after_template_render =&gt; sub {
my $html_ref = shift;
};</code></pre>
</dd>
<dt id="after_layout_render">after_layout_render</dt>
<dd>
<p>This hook receives as argument a ScalarRef representing the content generated by the layout</p>
<pre><code> hook after_layout_render =&gt; sub {
my $html_ref = shift;
};</code></pre>
</dd>
<dt id="after1">after</dt>
<dd>
<p>This is an alias for <code>after</code>.</p>
<p>This hook runs after a request has been processed, but before the response is sent.</p>
<p>It receives a <a href="/module/Dancer::Response">Dancer::Response</a> object, which it can modify if it needs to make changes to the response which is about to be sent.</p>
<pre><code> hook after =&gt; sub {
my $response = shift;
};</code></pre>
<p>This is equivalent to</p>
<pre><code> after sub {
my $response = shift;
};</code></pre>
</dd>
<dt id="after_error_render">after_error_render</dt>
<dd>
<p>This hook receives as argument a <a href="/module/Dancer::Response">Dancer::Response</a> object.</p>
<pre><code> hook after_error_render =&gt; sub {
my $response = shift;
};</code></pre>
</dd>
<dt id="on_handler_exception">on_handler_exception</dt>
<dd>
<p>This hook is called when an exception has been caught, at the handler level, just before creating and rendering <a href="/module/Dancer::Error">Dancer::Error</a>. This hook receives as argument a <a href="/module/Dancer::Exception">Dancer::Exception</a> object.</p>
<pre><code> hook on_handler_exception =&gt; sub {
my $exception = shift;
};</code></pre>
</dd>
<dt id="on_route_exception">on_route_exception</dt>
<dd>
<p>This hook is called when an exception has been caught, at the route level, just before rethrowing it higher. This hook receives the exception as argument. It can be a Dancer::Exception, or a string, or whatever was used to <code>die</code>.</p>
<pre><code> hook on_route_exception =&gt; sub {
my $exception = shift;
};</code></pre>
</dd>
</dl>
<h2 id="info">info</h2>
<p>Logs a message of info level:</p>
<pre><code> info &quot;This is a info message&quot;;</code></pre>
<p>See <a href="/module/Dancer::Logger">Dancer::Logger</a> for details on how to configure where log messages go.</p>
<h2 id="layout">layout</h2>
<p>This method is deprecated. Use <code>set</code>:</p>
<pre><code> set layout =&gt; &#39;user&#39;;</code></pre>
<h2 id="logger">logger</h2>
<p>Deprecated. Use <code>&lt;set logger =&gt; &#39;console&#39;</code>&gt; to change current logger engine.</p>
<h2 id="load">load</h2>
<p>Loads one or more perl scripts in the current application&#39;s namespace. Syntactic sugar around Perl&#39;s <code>require</code>:</p>
<pre><code> load &#39;UserActions.pl&#39;, &#39;AdminActions.pl&#39;;</code></pre>
<h2 id="load_app">load_app</h2>
<p>Loads a Dancer package. This method sets the libdir to the current <code>./lib</code> directory:</p>
<pre><code> # if we have lib/Webapp.pm, we can load it like:
load_app &#39;Webapp&#39;;
# or with options
load_app &#39;Forum&#39;, prefix =&gt; &#39;/forum&#39;, settings =&gt; {foo =&gt; &#39;bar&#39;};</code></pre>
<p>Note that the package loaded using load_app <b>must</b> import Dancer with the <code>:syntax</code> option.</p>
<p>To load multiple apps repeat load_app:</p>
<pre><code> load_app &#39;one&#39;;
load_app &#39;two&#39;;</code></pre>
<p>The old way of loading multiple apps in one go (load_app &#39;one&#39;, &#39;two&#39;;) is deprecated.</p>
<h2 id="mime">mime</h2>
<p>Shortcut to access the instance object of <a href="/module/Dancer::MIME">Dancer::MIME</a>. You should read the <a href="/module/Dancer::MIME">Dancer::MIME</a> documentation for full details, but the most commonly-used methods are summarized below:</p>
<pre><code> # set a new mime type
mime-&gt;add_type( foo =&gt; &#39;text/foo&#39; );
# set a mime type alias
mime-&gt;add_alias( f =&gt; &#39;foo&#39; );
# get mime type for an alias
my $m = mime-&gt;for_name( &#39;f&#39; );
# get mime type for a file (based on extension)
my $m = mime-&gt;for_file( &quot;foo.bar&quot; );
# get current defined default mime type
my $d = mime-&gt;default;
# set the default mime type using config.yml
# or using the set keyword
set default_mime_type =&gt; &#39;text/plain&#39;;</code></pre>
<h2 id="params">params</h2>
<p><i>This method should be called from a route handler</i>. It&#39;s an alias for the <a href="/module/Dancer::Request#params">Dancer::Request params accessor</a>. It returns an hash reference to all defined parameters. Check <code>param</code> bellow to access quickly to a single parameter value.</p>
<h2 id="param">param</h2>
<p><i>This method should be called from a route handler</i>. This method is an accessor to the parameters hash table.</p>
<pre><code> post &#39;/login&#39; =&gt; sub {
my $username = param &quot;user&quot;;
my $password = param &quot;pass&quot;;
# ...
}</code></pre>
<h2 id="pass">pass</h2>
<p><i>This method should be called from a route handler</i>. Tells Dancer to pass the processing of the request to the next matching route.</p>
<p><b>WARNING</b> : Issuing a pass immediately exits the current route, and perform the pass. Thus, any code after a pass is ignored, until the end of the route. So it&#39;s not necessary anymore to use <code>return</code> with pass.</p>
<pre><code> get &#39;/some/route&#39; =&gt; sub {
if (...) {
# we want to let the next matching route handler process this one
pass(...);
# This code will be ignored
do_stuff();
}
};</code></pre>
<h2 id="patch">patch</h2>
<p>Defines a route for HTTP <b>PATCH</b> requests to the given URL:</p>
<pre><code> patch &#39;/resource&#39; =&gt; sub { ... };</code></pre>
<p>(<code>PATCH</code> is a relatively new and not-yet-common HTTP verb, which is intended to work as a &quot;partial-PUT&quot;, transferring just the changes; please see <a href="http://tools.ietf.org/html/rfc5789|RFC5789">http://tools.ietf.org/html/rfc5789|RFC5789</a> for further details.)</p>
<p>Please be aware that, if you run your app in standalone mode, <code>PATCH</code> requests will not reach your app unless you have a new version of <a href="/module/HTTP::Server::Simple">HTTP::Server::Simple</a> which accepts <code>PATCH</code> as a valid verb. The current version at time of writing, <code>0.44</code>, does not. A pull request has been submitted to add this support, which you can find at:</p>
<p><a href="https://github.com/bestpractical/http-server-simple/pull/1">https://github.com/bestpractical/http-server-simple/pull/1</a></p>
<h2 id="path">path</h2>
<p>Concatenates multiple paths together, without worrying about the underlying operating system:</p>
<pre><code> my $path = path(dirname($0), &#39;lib&#39;, &#39;File.pm&#39;);</code></pre>
<p>It also normalizes (cleans) the path aesthetically. It does not verify the path exists.</p>
<h2 id="post">post</h2>
<p>Defines a route for HTTP <b>POST</b> requests to the given URL:</p>
<pre><code> post &#39;/&#39; =&gt; sub {
return &quot;Hello world&quot;;
}</code></pre>
<h2 id="prefix">prefix</h2>
<p>Defines a prefix for each route handler, like this:</p>
<pre><code> prefix &#39;/home&#39;;</code></pre>
<p>From here, any route handler is defined to /home/*:</p>
<pre><code> get &#39;/page1&#39; =&gt; sub {}; # will match &#39;/home/page1&#39;</code></pre>
<p>You can unset the prefix value:</p>
<pre><code> prefix undef;
get &#39;/page1&#39; =&gt; sub {}; will match /page1</code></pre>
<p>For a safer alternative you can use lexical prefix like this:</p>
<pre><code> prefix &#39;/home&#39; =&gt; sub {
## Prefix is set to &#39;/home&#39; here
get ...;
get ...;
};
## prefix reset to the previous version here</code></pre>
<p>This makes it possible to nest prefixes:</p>
<pre><code> prefix &#39;/home&#39; =&gt; sub {
## some routes
prefix &#39;/private&#39; =&gt; sub {
## here we are under /home/private...
## some more routes
};
## back to /home
};
## back to the root</code></pre>
<p><b>Notice:</b> once you have a prefix set, do not add a caret to the regex:</p>
<pre><code> prefix &#39;/foo&#39;;
get qr{^/bar} =&gt; sub { ... } # BAD BAD BAD
get qr{/bar} =&gt; sub { ... } # Good!</code></pre>
<h2 id="del">del</h2>
<p>Defines a route for HTTP <b>DELETE</b> requests to the given URL:</p>
<pre><code> del &#39;/resource&#39; =&gt; sub { ... };</code></pre>
<h2 id="options">options</h2>
<p>Defines a route for HTTP <b>OPTIONS</b> requests to the given URL:</p>
<pre><code> options &#39;/resource&#39; =&gt; sub { ... };</code></pre>
<h2 id="put">put</h2>
<p>Defines a route for HTTP <b>PUT</b> requests to the given URL:</p>
<pre><code> put &#39;/resource&#39; =&gt; sub { ... };</code></pre>
<h2 id="redirect">redirect</h2>
<p>Generates a HTTP redirect (302). You can either redirect to a complete different site or within the application:</p>
<pre><code> get &#39;/twitter&#39;, sub {
redirect &#39;http://twitter.com/me&#39;;
};</code></pre>
<p>You can also force Dancer to return a specific 300-ish HTTP response code:</p>
<pre><code> get &#39;/old/:resource&#39;, sub {
redirect &#39;/new/&#39;.params-&gt;{resource}, 301;
};</code></pre>
<p>It is important to note that issuing a redirect by itself does not exit and redirect immediately, redirection is deferred until after the current route or filter has been processed. To exit and redirect immediately, use the return function, e.g.</p>
<pre><code> get &#39;/restricted&#39;, sub {
return redirect &#39;/login&#39; if accessDenied();
return &#39;Welcome to the restricted section&#39;;
};</code></pre>
<h2 id="render_with_layout">render_with_layout</h2>
<p>Allows a handler to provide plain HTML (or other content), but have it rendered within the layout still.</p>
<p>This method is <b>DEPRECATED</b>, and will be removed soon. Instead, you should be using the <code>engine</code> keyword:</p>
<pre><code> get &#39;/foo&#39; =&gt; sub {
# Do something which generates HTML directly (maybe using
# HTML::Table::FromDatabase or something)
my $content = ...;
# get the template engine
my $template_engine = engine &#39;template&#39;;
# apply the layout (not the renderer), and return the result
$template_engine-&gt;apply_layout($content)
};</code></pre>
<p>It works very similarly to <code>template</code> in that you can pass tokens to be used in the layout, and/or options to control the way the layout is rendered. For instance, to use a custom layout:</p>
<pre><code> render_with_layout $content, {}, { layout =&gt; &#39;layoutname&#39; };</code></pre>
<h2 id="request">request</h2>
<p>Returns a <a href="/module/Dancer::Request">Dancer::Request</a> object representing the current request.</p>
<p>See the <a href="/module/Dancer::Request">Dancer::Request</a> documention for the methods you can call, for example:</p>
<pre><code> request-&gt;referer; # value of the HTTP referer header
request-&gt;remote_address; # user&#39;s IP address
request-&gt;user_agent; # User-Agent header value</code></pre>
<h2 id="send_error">send_error</h2>
<p>Returns a HTTP error. By default the HTTP code returned is 500:</p>
<pre><code> get &#39;/photo/:id&#39; =&gt; sub {
if (...) {
send_error(&quot;Not allowed&quot;, 403);
} else {
# return content
}
}</code></pre>
<p><b>WARNING</b> : Issuing a send_error immediately exits the current route, and perform the send_error. Thus, any code after a send_error is ignored, until the end of the route. So it&#39;s not necessary anymore to use <code>return</code> with send_error.</p>
<pre><code> get &#39;/some/route&#39; =&gt; sub {
if (...) {
# we want to let the next matching route handler process this one
send_error(..);
# This code will be ignored
do_stuff();
}
};</code></pre>
<h2 id="send_file">send_file</h2>
<p>Lets the current route handler send a file to the client. Note that the path of the file must be relative to the <b>public</b> directory unless you use the <code>system_path</code> option (see below).</p>
<pre><code> get &#39;/download/:file&#39; =&gt; sub {
return send_file(params-&gt;{file});
}</code></pre>
<p><b>WARNING</b> : Issuing a send_file immediately exits the current route, and perform the send_file. Thus, any code after a send_file is ignored, until the end of the route. So it&#39;s not necessary anymore to use <code>return</code> with send_file.</p>
<pre><code> get &#39;/some/route&#39; =&gt; sub {
if (...) {
# we want to let the next matching route handler process this one
send_file(...);
# This code will be ignored
do_stuff();
}
};</code></pre>
<p>Send file supports streaming possibility using PSGI streaming. The server should support it but normal streaming is supported on most, if not all.</p>
<pre><code> get &#39;/download/:file&#39; =&gt; sub {
return send_file( params-&gt;{file}, streaming =&gt; 1 );
}</code></pre>
<p>You can control what happens using callbacks.</p>
<p>First, <code>around_content</code> allows you to get the writer object and the chunk of content read, and then decide what to do with each chunk:</p>
<pre><code> get &#39;/download/:file&#39; =&gt; sub {
return send_file(
params-&gt;{file},
streaming =&gt; 1,
callbacks =&gt; {
around_content =&gt; sub {
my ( $writer, $chunk ) = @_;
$writer-&gt;write(&quot;* $chunk&quot;);
},
},
);
}</code></pre>
<p>You can use <code>around</code> to all get all the content (whether a filehandle if it&#39;s a regular file or a full string if it&#39;s a scalar ref) and decide what to do with it:</p>
<pre><code> get &#39;/download/:file&#39; =&gt; sub {
return send_file(
params-&gt;{file},
streaming =&gt; 1,
callbacks =&gt; {
around =&gt; sub {
my ( $writer, $content 0 = shift;
# we know it&#39;s a text file, so we&#39;ll just stream
# line by line
while ( my $line = &lt;$content&gt; ) {
$writer-&gt;write($line);
}
},
},
);
}</code></pre>
<p>Or you could use <code>override</code> to control the entire streaming callback request:</p>
<pre><code> get &#39;/download/:file&#39; =&gt; sub {
return send_file(
params-&gt;{file},
streaming =&gt; 1,
callbacks =&gt; {
override =&gt; sub {
my ( $respond, $response ) = @_;
my $writer = $respond-&gt;( [ $newstatus, $newheaders ] );
$writer-&gt;write(&quot;some line&quot;);
},
},
);
}</code></pre>
<p>You can also set the number of bytes that will be read at a time (default being 42K bytes) using <code>bytes</code>:</p>
<pre><code> get &#39;/download/:file&#39; =&gt; sub {
return send_file(
params-&gt;{file},
streaming =&gt; 1,
bytes =&gt; 524288, # 512K
);
};</code></pre>
<p>The content-type will be set depending on the current MIME types definition (see <code>mime</code> if you want to define your own).</p>
<p>If your filename does not have an extension, or you need to force a specific mime type, you can pass it to <code>send_file</code> as follows:</p>
<pre><code> return send_file(params-&gt;{file}, content_type =&gt; &#39;image/png&#39;);</code></pre>
<p>Also, you can use your aliases or file extension names on <code>content_type</code>, like this:</p>
<pre><code> return send_file(params-&gt;{file}, content_type =&gt; &#39;png&#39;);</code></pre>
<p>For files outside your <b>public</b> folder, you can use the <code>system_path</code> switch. Just bear in mind that its use needs caution as it can be dangerous.</p>
<pre><code> return send_file(&#39;/etc/passwd&#39;, system_path =&gt; 1);</code></pre>
<p>If you have your data in a scalar variable, <code>send_file</code> can be useful as well. Pass a reference to that scalar, and <code>send_file</code> will behave as if there was a file with that contents:</p>
<pre><code> return send_file( \$data, content_type =&gt; &#39;image/png&#39; );</code></pre>
<p>Note that Dancer is unable to guess the content type from the data contents. Therefore you might need to set the <code>content_type</code> properly. For this kind of usage an attribute named <code>filename</code> can be useful. It is used as the Content-Disposition header, to hint the brower about the filename it should use.</p>
<pre><code> return send_file( \$data, content_type =&gt; &#39;image/png&#39;
filename =&gt; &#39;onion.png&#39; );</code></pre>
<p>Note that you should always use <code>return send_file ...</code> to stop execution of your route handler at that point.</p>
<h2 id="set">set</h2>
<p>Defines a setting:</p>
<pre><code> set something =&gt; &#39;value&#39;;</code></pre>
<p>You can set more than one value at once:</p>
<pre><code> set something =&gt; &#39;value&#39;, otherthing =&gt; &#39;othervalue&#39;;</code></pre>
<h2 id="setting">setting</h2>
<p>Returns the value of a given setting:</p>
<pre><code> setting(&#39;something&#39;); # &#39;value&#39;</code></pre>
<h2 id="set_cookie">set_cookie</h2>
<p>Creates or updates cookie values:</p>
<pre><code> get &#39;/some_action&#39; =&gt; sub {
set_cookie name =&gt; &#39;value&#39;,
expires =&gt; (time + 3600),
domain =&gt; &#39;.foo.com&#39;;
};</code></pre>
<p>In the example above, only &#39;name&#39; and &#39;value&#39; are mandatory.</p>
<p>You can also store more complex structure in your cookies:</p>
<pre><code> get &#39;/some_auth&#39; =&gt; sub {
set_cookie oauth =&gt; {
token =&gt; $twitter-&gt;request_token,
token_secret =&gt; $twitter-&gt;secret_token,
...
};
};</code></pre>
<p>You can&#39;t store more complex structure than this. All keys in the HashRef should be Scalars; storing references will not work.</p>
<p>See <a href="/module/Dancer::Cookie">Dancer::Cookie</a> for further options when creating your cookie.</p>
<p>Note that this method will be eventually deprecated in favor of the new <code>cookie</code> method.</p>
<h2 id="session">session</h2>
<p>Provides access to all data stored in the user&#39;s session (if any).</p>
<p>It can also be used as a setter to store data in the session:</p>
<pre><code> # getter example
get &#39;/user&#39; =&gt; sub {
if (session(&#39;user&#39;)) {
return &quot;Hello, &quot;.session(&#39;user&#39;)-&gt;name;
}
};
# setter example
post &#39;/user/login&#39; =&gt; sub {
...
if ($logged_in) {
session user =&gt; $user;
}
...
};</code></pre>
<p>You may also need to clear a session:</p>
<pre><code> # destroy session
get &#39;/logout&#39; =&gt; sub {
...
session-&gt;destroy;
...
};</code></pre>
<p>If you need to fetch the session ID being used for any reason:</p>
<pre><code> my $id = session-&gt;id;</code></pre>
<h2 id="splat">splat</h2>
<p>Returns the list of captures made from a route handler with a route pattern which includes wildcards:</p>
<pre><code> get &#39;/file/*.*&#39; =&gt; sub {
my ($file, $extension) = splat;
...
};</code></pre>
<p>There is also the extensive splat (A.K.A. &quot;megasplat&quot;), which allows extensive greedier matching, available using two asterisks. The additional path is broken down and returned as an ArrayRef:</p>
<pre><code> get &#39;/entry/*/tags/**&#39; =&gt; sub {
my ( $entry_id, $tags ) = splat;
my @tags = @{$tags};
};</code></pre>
<p>This helps with chained actions:</p>
<pre><code> get &#39;/team/*/**&#39; =&gt; sub {
my ($team) = splat;
var team =&gt; $team;
pass;
};
prefix &#39;/team/*&#39;;
get &#39;/player/*&#39; =&gt; sub {
my ($player) = splat;
# etc...
};
get &#39;/score&#39; =&gt; sub {
return score_for( vars-&gt;{&#39;team&#39;} );
};</code></pre>
<h2 id="start">start</h2>
<p>Starts the application or the standalone server (depending on the deployment choices).</p>
<p>This keyword should be called at the very end of the script, once all routes are defined. At this point, Dancer takes over control.</p>
<h2 id="status">status</h2>
<p>Changes the status code provided by an action. By default, an action will produce an <code>HTTP 200 OK</code> status code, meaning everything is OK:</p>
<pre><code> get &#39;/download/:file&#39; =&gt; {
if (! -f params-&gt;{file}) {
status &#39;not_found&#39;;
return &quot;File does not exist, unable to download&quot;;
}
# serving the file...
};</code></pre>
<p>In that example, Dancer will notice that the status has changed, and will render the response accordingly.</p>
<p>The status keyword receives either a numeric status code or its name in lower case, with underscores as a separator for blanks - see the list in <a href="/module/Dancer::HTTP#HTTP-CODES">&quot;HTTP CODES&quot; in Dancer::HTTP</a>.</p>
<h2 id="template">template</h2>
<p>Returns the response of processing the given template with the given parameters (and optional settings), wrapping it in the default or specified layout too, if layouts are in use.</p>
<p>An example of a route handler which returns the result of using template to build a response with the current template engine:</p>
<pre><code> get &#39;/&#39; =&gt; sub {
...
return template &#39;some_view&#39;, { token =&gt; &#39;value&#39;};
};</code></pre>
<p>Note that <code>template</code> simply returns the content, so when you use it in a route handler, if execution of the the route handler should stop at that point, make sure you use &#39;return&#39; to ensure your route handler returns the content.</p>
<p>Since template just returns the result of rendering the template, you can also use it to perform other templating tasks, e.g. generating emails:</p>
<pre><code> post &#39;/some/route&#39; =&gt; sub {
if (...) {
email {
to =&gt; &#39;someone@example.com&#39;,
from =&gt; &#39;foo@example.com&#39;,
subject =&gt; &#39;Hello there&#39;,
msg =&gt; template(&#39;emails/foo&#39;, { name =&gt; params-&gt;{name} }),
};
return template &#39;message_sent&#39;;
} else {
return template &#39;error&#39;;
}
};</code></pre>
<p>Compatibility notice: <code>template</code> was changed in version 1.3090 to immediately interrupt execution of a route handler and return the content, as it&#39;s typically used at the end of a route handler to return content. However, this caused issues for some people who were using <code>template</code> to generate emails etc, rather than accessing the template engine directly, so this change has been reverted in 1.3091.</p>
<p>The first parameter should be a template available in the views directory, the second one (optional) is a HashRef of tokens to interpolate, and the third (again optional) is a HashRef of options.</p>
<p>For example, to disable the layout for a specific request:</p>
<pre><code> get &#39;/&#39; =&gt; sub {
template &#39;index&#39;, {}, { layout =&gt; undef };
};</code></pre>
<p>Or to request a specific layout, of course:</p>
<pre><code> get &#39;/user&#39; =&gt; sub {
template &#39;user&#39;, {}, { layout =&gt; &#39;user&#39; };
};</code></pre>
<p>Some tokens are automatically added to your template (<code>perl_version</code>, <code>dancer_version</code>, <code>settings</code>, <code>request</code>, <code>params</code>, <code>vars</code> and, if you have sessions enabled, <code>session</code>). Check <a href="/module/Dancer::Template::Abstract">Dancer::Template::Abstract</a> for further details.</p>
<h2 id="to_dumper-structure-">to_dumper ($structure)</h2>
<p>Serializes a structure with Data::Dumper.</p>
<h2 id="to_json-structure-options-">to_json ($structure, %options)</h2>
<p>Serializes a structure to JSON. Can receive optional arguments. Thoses arguments are valid <a href="/module/JSON">JSON</a> arguments to change the behaviour of the default <code>JSON::to_json</code> function.</p>
<h2 id="to_yaml-structure-">to_yaml ($structure)</h2>
<p>Serializes a structure to YAML.</p>
<h2 id="to_xml-structure-options-">to_xml ($structure, %options)</h2>
<p>Serializes a structure to XML. Can receive optional arguments. Thoses arguments are valid <a href="/module/XML::Simple">XML::Simple</a> arguments to change the behaviour of the default <code>XML::Simple::XMLout</code> function.</p>
<h2 id="true">true</h2>
<p>Constant that returns a true value (1).</p>
<h2 id="upload">upload</h2>
<p>Provides access to file uploads. Any uploaded file is accessible as a <a href="/module/Dancer::Request::Upload">Dancer::Request::Upload</a> object. You can access all parsed uploads via:</p>
<pre><code> post &#39;/some/route&#39; =&gt; sub {
my $file = upload(&#39;file_input_foo&#39;);
# file is a Dancer::Request::Upload object
};</code></pre>
<p>If you named multiple input of type &quot;file&quot; with the same name, the upload keyword will return an Array of Dancer::Request::Upload objects:</p>
<pre><code> post &#39;/some/route&#39; =&gt; sub {
my ($file1, $file2) = upload(&#39;files_input&#39;);
# $file1 and $file2 are Dancer::Request::Upload objects
};</code></pre>
<p>You can also access the raw HashRef of parsed uploads via the current request object:</p>
<pre><code> post &#39;/some/route&#39; =&gt; sub {
my $all_uploads = request-&gt;uploads;
# $all_uploads-&gt;{&#39;file_input_foo&#39;} is a Dancer::Request::Upload object
# $all_uploads-&gt;{&#39;files_input&#39;} is an ArrayRef of Dancer::Request::Upload objects
};</code></pre>
<p>Note that you can also access the filename of the upload received via the params keyword:</p>
<pre><code> post &#39;/some/route&#39; =&gt; sub {
# params-&gt;{&#39;files_input&#39;} is the filename of the file uploaded
};</code></pre>
<p>See <a href="/module/Dancer::Request::Upload">Dancer::Request::Upload</a> for details about the interface provided.</p>
<h2 id="uri_for">uri_for</h2>
<p>Returns a fully-qualified URI for the given path:</p>
<pre><code> get &#39;/&#39; =&gt; sub {
redirect uri_for(&#39;/path&#39;);
# can be something like: http://localhost:3000/path
};</code></pre>
<h2 id="captures">captures</h2>
<p>Returns a reference to a copy of <code>%+</code>, if there are named captures in the route Regexp.</p>
<p>Named captures are a feature of Perl 5.10, and are not supported in earlier versions:</p>
<pre><code> get qr{
/ (?&lt;object&gt; user | ticket | comment )
/ (?&lt;action&gt; delete | find )
/ (?&lt;id&gt; \d+ )
/?$
}x
, sub {
my $value_for = captures;
&quot;i don&#39;t want to $$value_for{action} the $$value_for{object} $$value_for{id} !&quot;
};</code></pre>
<h2 id="var">var</h2>
<p>Provides an accessor for variables shared between filters and route handlers. Given a key/value pair, it sets a variable:</p>
<pre><code> before sub {
var foo =&gt; 42;
};</code></pre>
<p>Later, route handlers and other filters will be able to read that variable:</p>
<pre><code> get &#39;/path&#39; =&gt; sub {
my $foo = var &#39;foo&#39;;
...
};</code></pre>
<h2 id="vars">vars</h2>
<p>Returns the HashRef of all shared variables set during the filter/route chain with the <code>var</code> keyword:</p>
<pre><code> get &#39;/path&#39; =&gt; sub {
if (vars-&gt;{foo} eq 42) {
...
}
};</code></pre>
<h2 id="warning">warning</h2>
<p>Logs a warning message through the current logger engine:</p>
<pre><code> warning &quot;This is a warning&quot;;</code></pre>
<p>See <a href="/module/Dancer::Logger">Dancer::Logger</a> for details on how to configure where log messages go.</p>
<h1 id="AUTHOR">AUTHOR</h1>
<p>This module has been written by Alexis Sukrieh &lt;sukria@cpan.org&gt; and others, see the AUTHORS file that comes with this distribution for details.</p>
<h1 id="SOURCE-CODE">SOURCE CODE</h1>
<p>The source code for this module is hosted on GitHub <a href="http://github.com/sukria/Dancer">http://github.com/sukria/Dancer</a>. Feel free to fork the repository and submit pull requests! (See <a href="/module/Dancer::Development">Dancer::Development</a> for details on how to contribute).</p>
<p>Also, why not <a href="https://github.com/sukria/Dancer/toggle_watch">watch the repo</a> to keep up to date with the latest upcoming changes?</p>
<h1 id="GETTING-HELP-CONTRIBUTING">GETTING HELP / CONTRIBUTING</h1>
<p>The Dancer development team can be found on #dancer on irc.perl.org: <a href="irc://irc.perl.org/dancer">irc://irc.perl.org/dancer</a></p>
<p>If you don&#39;t have an IRC client installed/configured, there is a simple web chat client at <a href="http://www.perldancer.org/irc">http://www.perldancer.org/irc</a> for you.</p>
<p>There is also a Dancer users mailing list available - subscribe at:</p>
<p><a href="http://lists.perldancer.org/cgi-bin/listinfo/dancer-users">http://lists.perldancer.org/cgi-bin/listinfo/dancer-users</a></p>
<p>If you&#39;d like to contribute to the Dancer project, please see <a href="http://www.perldancer.org/contribute">http://www.perldancer.org/contribute</a> for all the ways you can help!</p>
<h1 id="DEPENDENCIES">DEPENDENCIES</h1>
<p>The following modules are mandatory (Dancer cannot run without them):</p>
<dl>
<dt id="HTTP::Server::Simple::PSGI"><a href="/module/HTTP::Server::Simple::PSGI">HTTP::Server::Simple::PSGI</a></dt>
<dd>
</dd>
<dt id="HTTP::Body"><a href="/module/HTTP::Body">HTTP::Body</a></dt>
<dd>
</dd>
<dt id="LWP"><a href="/module/LWP">LWP</a></dt>
<dd>
</dd>
<dt id="MIME::Types"><a href="/module/MIME::Types">MIME::Types</a></dt>
<dd>
</dd>
<dt id="URI"><a href="/module/URI">URI</a></dt>
<dd>
</dd>
</dl>
<p>The following modules are optional:</p>
<dl>
<dt id="JSON-:-needed-to-use-JSON-serializer"><a href="/module/JSON">JSON</a> : needed to use JSON serializer</dt>
<dd>
</dd>
<dt id="Plack-:-in-order-to-use-PSGI"><a href="/module/Plack">Plack</a> : in order to use PSGI</dt>
<dd>
</dd>
<dt id="Template-:-in-order-to-use-TT-for-rendering-views"><a href="/module/Template">Template</a> : in order to use TT for rendering views</dt>
<dd>
</dd>
<dt id="XML::Simple-and-XML:SAX-or-XML:Parser-for-XML-serialization"><a href="/module/XML::Simple">XML::Simple</a> and <a href="XML:SAX">XML:SAX</a> or <a href="XML:Parser">XML:Parser</a> for XML serialization</dt>
<dd>
</dd>
<dt id="YAML-:-needed-for-configuration-file-support"><a href="/module/YAML">YAML</a> : needed for configuration file support</dt>
<dd>
</dd>
</dl>
<h1 id="LICENSE">LICENSE</h1>
<p>This module is free software and is published under the same terms as Perl itself.</p>
<h1 id="SEE-ALSO">SEE ALSO</h1>
<p>Main Dancer web site: <a href="http://perldancer.org/">http://perldancer.org/</a>.</p>
<p>The concept behind this module comes from the Sinatra ruby project, see <a href="http://www.sinatrarb.com/">http://www.sinatrarb.com/</a> for details.</p>
</div>
<!-- JS at the bottom for faster page load -->
<script src="/js/jquery.min.js"></script>
<script src="/js/jquery.hashgrid.js"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/jquery.quicksearch.js"></script>
<script src="/js/highlight.min.js"></script>
<script src="/js/app.js"></script>
<!-- Prompt IE 6 users to install Chrome Frame. Remove this to 'support' IE 6. -->
<!-- http://chromium.org/developers/how-tos/chrome-frame-getting-started -->
<!--[if lt IE 7 ]>
<script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.3/CFInstall.min.js"></script>
<script>window.attachEvent('onload',function(){CFInstall.check({mode:'overlay'})})</script>
<![endif]-->
</body>
</html>