.\" Automatically generated by Pod::Man 2.25 (Pod::Simple 3.16) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is turned on, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .ie \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . nr % 0 . rr F .\} .el \{\ . de IX .. .\} .\" .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). .\" Fear. Run. Save yourself. No user-serviceable parts. . \" fudge factors for nroff and troff .if n \{\ . ds #H 0 . ds #V .8m . ds #F .3m . ds #[ \f1 . ds #] \fP .\} .if t \{\ . ds #H ((1u-(\\\\n(.fu%2u))*.13m) . ds #V .6m . ds #F 0 . ds #[ \& . ds #] \& .\} . \" simple accents for nroff and troff .if n \{\ . ds ' \& . ds ` \& . ds ^ \& . ds , \& . ds ~ ~ . ds / .\} .if t \{\ . ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" . ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' . ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' . ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' . ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' . ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' .\} . \" troff and (daisy-wheel) nroff accents .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' .ds 8 \h'\*(#H'\(*b\h'-\*(#H' .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] .ds ae a\h'-(\w'a'u*4/10)'e .ds Ae A\h'-(\w'A'u*4/10)'E . \" corrections for vroff .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' . \" for low resolution devices (crt and lpr) .if \n(.H>23 .if \n(.V>19 \ \{\ . ds : e . ds 8 ss . ds o a . ds d- d\h'-1'\(ga . ds D- D\h'-1'\(hy . ds th \o'bp' . ds Th \o'LP' . ds ae ae . ds Ae AE .\} .rm #[ #] #H #V #F C .\" ======================================================================== .\" .IX Title "Jifty::View::Declare::Helpers 3pm" .TH Jifty::View::Declare::Helpers 3pm "2010-09-25" "perl v5.14.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" Jifty::View::Declare::Helpers \- Additional subroutines for Jifty TD templates .SH "DESCRIPTION" .IX Header "DESCRIPTION" This library provides mixins to help build your application's user interface. .SH "METHODS" .IX Header "METHODS" .SS "Arguments" .IX Subsection "Arguments" \fIget args\fR .IX Subsection "get args" .PP Returns arguments as set in the dispatcher or with \*(L"set\*(R" below. If called in scalar context, pulls the first item in \f(CW\*(C`args\*(C'\fR and returns it. If called in list context, returns the values of all items in \f(CW\*(C`args\*(C'\fR. .PP .Vb 2 \& my $action = get(\*(Aqaction\*(Aq); \& my ($action, $object) = get(qw(action object)); .Ve .PP \fIset key => val [ key => val ...]\fR .IX Subsection "set key => val [ key => val ...]" .PP Sets arguments for later grabbing with get. .SS "\s-1HTML\s0 pages and layouts" .IX Subsection "HTML pages and layouts" \fIpage\fR .IX Subsection "page" .PP .Vb 1 \& template \*(Aqfoo\*(Aq => page {{ title is \*(AqFoo\*(Aq } ... }; \& \& or \& \& template \*(Aqfoo\*(Aq => page { title => \*(AqFoo\*(Aq } content { ... }; .Ve .PP Renders an \s-1HTML\s0 page wrapped in \*(L"wrapper\*(R", after calling \&\*(L"/_elements/nav\*(R" and setting a content type. Generally, you shouldn't be using \*(L"/_elements/nav\*(R" but a Dispatcher rule instead. .PP If \f(CW\*(C`page/content\*(C'\fR calling convention is used, the return value of the first sub will be passed into wrapper as the second argument as a hashref, as well as the last argument for the content sub. .PP \fIcontent\fR .IX Subsection "content" .PP Helper function for page { ... } content { ... }, read \*(L"page\*(R" instead. .PP \fIwrapper \f(CI$coderef\fI\fR .IX Subsection "wrapper $coderef" .PP Render a page. \f(CW$coderef\fR is a Template::Declare coderef. This badly wants to be redone. .SS "Forms and actions" .IX Subsection "Forms and actions" \fIform \s-1CODE\s0\fR .IX Subsection "form CODE" .PP Takes a subroutine reference or block of perl as its only argument and renders it as a Jifty \f(CW\*(C`form\*(C'\fR, for example: .PP .Vb 6 \& my $action = new_action class => \*(AqCreateTask\*(Aq; \& form { \& form_next_page url => \*(Aq/\*(Aq; \& render_action $action; \& form_submit( label => _(\*(AqCreate\*(Aq) ); \& }; .Ve .PP You can specify the form name using \*(L"with\*(R" in Template::Declare::Tags, like so: .PP .Vb 3 \& with (name => \*(Aqcreate_task\*(Aq), form { \& ... \& }; .Ve .PP \fInew_action\fR .IX Subsection "new_action" .PP Shortcut for \*(L"new_action\*(R" in Jifty::Web. .PP \fIrender_action \f(CI$action_object\fI, \f(CI$fields\fI, \f(CI$args_to_pass_to_action\fI\fR .IX Subsection "render_action $action_object, $fields, $args_to_pass_to_action" .PP Renders an action out of whole cloth. .PP Arguments .ie n .IP "$action_object" 4 .el .IP "\f(CW$action_object\fR" 4 .IX Item "$action_object" A Jifty::Action object which has already been initialized .ie n .IP "$fields" 4 .el .IP "\f(CW$fields\fR" 4 .IX Item "$fields" A reference to an array of fields that should be rendered when displaying this action. If left undefined, all of the action's fields will be rendered. .ie n .IP "$args_to_pass_to_action" 4 .el .IP "\f(CW$args_to_pass_to_action\fR" 4 .IX Item "$args_to_pass_to_action" A hashref of arguments that should be passed to \f(CW$action\fR\->form_field for every field of this action. .ie n .SS "render_param $action, $param, %args" .el .SS "render_param \f(CW$action\fP, \f(CW$param\fP, \f(CW%args\fP" .IX Subsection "render_param $action, $param, %args" Takes an action and one or more arguments to pass to Jifty::Action\->form_field. .ie n .SS "render_hidden $action $name $default @args" .el .SS "render_hidden \f(CW$action\fP \f(CW$name\fP \f(CW$default\fP \f(CW@args\fP" .IX Subsection "render_hidden $action $name $default @args" Takes an action and one or more arguments to pass to Jifty::Action\->hidden .PP \fIform_return\fR .IX Subsection "form_return" .PP Shortcut for \*(L"return\*(R" in Jifty::Web::Form. .PP \fIform_submit\fR .IX Subsection "form_submit" .PP Shortcut for \*(L"submit\*(R" in Jifty::Web::Form. .PP \fIform_next_page\fR .IX Subsection "form_next_page" .PP Shortcut for \*(L"next_page\*(R" in Jifty::Web::Form. .SS "Other functions and shortcuts" .IX Subsection "Other functions and shortcuts" \fIhyperlink\fR .IX Subsection "hyperlink" .PP Shortcut for \*(L"link\*(R" in Jifty::Web. .PP \fItangent\fR .IX Subsection "tangent" .PP Shortcut for \*(L"tangent\*(R" in Jifty::Web. .PP \fIredirect\fR .IX Subsection "redirect" .PP Shortcut for \*(L"redirect\*(R" in Jifty::Web. .PP \fIrender_region\fR .IX Subsection "render_region" .PP A shortcut for \f(CW\*(C`Jifty::Web::PageRegion\->new(@_)\->render\*(C'\fR which does the Template::Declare magic necessary to not mix its output with your current page's. .PP \fIrequest\fR .IX Subsection "request" .PP Shortcut for \*(L"request\*(R" in Jifty::Web. .PP \fIcurrent_user\fR .IX Subsection "current_user" .PP Shortcut for \*(L"current_user\*(R" in Jifty::Web. .PP \fIjs_handlers\fR .IX Subsection "js_handlers" .PP Allows you to put javascript handlers, a la Jifty::Web::Form::Element, onto arbitrary \s-1HTML\s0 elements: .PP .Vb 5 \& div { \& js_handlers { \& onclick => { path => "/some/region/path" } \& } \& } .Ve .PP \fIrender_mason \s-1PATH\s0, \s-1ARGS\s0\fR .IX Subsection "render_mason PATH, ARGS" .PP Renders the Mason template at \f(CW\*(C`PATH\*(C'\fR (a string) with \f(CW\*(C`ARGS\*(C'\fR (a hashref).