-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathindex.html
More file actions
1786 lines (1303 loc) · 76.3 KB
/
index.html
File metadata and controls
1786 lines (1303 loc) · 76.3 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!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 '/hello/:name' => sub {
return "Why, hello there " . param('name');
};
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'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 "set" and "any"
use Test::Most;
use Dancer qw(:syntax :tests !set !any);
# Alternatively, if you want to use Dancer'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 ':script';
MyApp::schema('DBSchema')->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't plan to use them and they clash with another module you'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 ['get', 'post'] => '/myaction' => sub {
# code
};</code></pre>
<p>Or even, a route handler that would match any HTTP methods:</p>
<pre><code> any '/myaction' => 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 '/some_action' => sub {
my $cookie = cookies->{name};
return $cookie->value;
};</code></pre>
<p>In the case you have stored something else than a Scalar in your cookie:</p>
<pre><code> get '/some_action' => sub {
my $cookie = cookies->{oauth};
my %values = $cookie->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 => "fr-FR"; # set a cookie and return its value
cookie lang => "fr-FR", expires => "2 hours"; # extra cookie info
cookie "lang" # return a cookie value</code></pre>
<p>If your cookie value is a key/value URI string, like</p>
<pre><code> token=ABC&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 "name";</code></pre>
<h2 id="config">config</h2>
<p>Accesses the configuration of the application:</p>
<pre><code> get '/appname' => sub {
return "This is " . config->{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 '/cat/:txtfile' => sub {
content_type 'text/plain';
# here we can dump the contents of param('txtfile')
};</code></pre>
<p>You can use abbreviations for content types. For instance:</p>
<pre><code> get '/svg/:id' => sub {
content_type 'svg';
# here we can dump the image with id param('id')
};</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 "This is a debug message";
</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 'template';
my $html = $template_engine->apply_renderer(...);
$template_engine->apply_layout($html);</code></pre>
<h2 id="error">error</h2>
<p>Logs a message of error level:</p>
<pre><code> error "This is an error message";</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 '/demo/articles/:article_id' => sub {
# you'll have to implement this next sub yourself :)
change_the_main_database_to_demo();
forward "/articles/" . params->{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'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'll notice that in the example we didn'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 '/foo/:article_id' => sub {
if ($condition) {
forward "/articles/" . params->{article_id};
# The following code is never executed
do_stuff();
}
more_stuff();
};</code></pre>
<p>So it's not necessary anymore to use <code>return</code> with forward.</p>
<p>Note that forward doesn't parse GET arguments. So, you can't use something like:</p>
<pre><code> return forward '/home?authorized=1';</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 '/home', { authorized => 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 '/home', { auth => 1 }, { method => 'POST' };</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 '/' => sub {
return "Hello world";
}</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("Unauthorized");
# This code is not executed :
do_stuff();
}
};
get '/' => sub {
"hello there";
};</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'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 '/send/headers', sub {
headers 'X-Foo' => 'bar', X-Bar => 'foo';
}</code></pre>
<h2 id="header">header</h2>
<p>adds a custom header to response:</p>
<pre><code> get '/send/header', sub {
header 'x-my-header' => 'shazam!';
}</code></pre>
<p>Note that it will overwrite the old value of the header, if any. To avoid that, see <a href="#push_header">"push_header"</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 '/send/header', sub {
push_header 'x-my-header' => '1';
push_header 'x-my-header' => '2';
will result in two headers "x-my-header" 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 => sub {
my $response = shift;
$response->content->{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 => 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 => 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 => 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 => 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 => 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 'before_template'.</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 => sub {
my $tokens = shift;
delete $tokens->{user};
$tokens->{time} = localtime;
};</code></pre>
<p>is equivalent to</p>
<pre><code> hook before_template => sub {
my $tokens = shift;
delete $tokens->{user};
$tokens->{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 => 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 => sub {
my $response = shift;
$response->content->{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 => 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 => 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 => 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 => 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 => 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 => 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 => sub {
my $exception = shift;
};</code></pre>
</dd>
<dt id="on_route_exception">on_route_exception</dt>
<dd>