.\" generated with Ronn/v0.7.3 .\" http://github.com/rtomayko/ronn/tree/0.7.3 . .TH "COMPOUND\-HELPERS" "3" "November 2013" "1602 Software" "CompoundJS" . .SH "NAME" \fBcompound\-helpers\fR \- view helpers . .SH "DESCRIPTION" Helpers produce html code\. \fIBuilt\-in\fR helpers available in any view\. Custom helpers available in specific controller, see \fICUSTOM HELPERS\fR section\. . .SH "BUILT\-IN HELPERS" . .SS "stylesheetLinkTag(file1[, file2[, \.\.\.[, fileN]]])" Generate \fB\fR tag\. Following ejs: . .IP "" 4 . .nf <%\- stylesheetLinkTag(\'reset\', \'style\', \'mobile\') %> . .fi . .IP "" 0 . .P will produce in develompent env: . .IP "" 4 . .nf . .fi . .IP "" 0 . .P and in production env: . .IP "" 4 . .nf . .fi . .IP "" 0 . .P depending on \fBapp\.set(\'merge stylesheets\');\fR option\. . .SS "javascriptIncludeTag" . .SS "linkTo" Generate html string \fBtext\fR\. Signature: . .IP "" 4 . .nf HelperSet\.prototype\.linkTo = function linkTo(text, url, params) . .fi . .IP "" 0 . .P Example: . .IP "" 4 . .nf linkTo(\'Home\', \'/\', {title: \'Go Home\'}); // Home . .fi . .IP "" 0 . .SS "contentFor" . .SS "anchor" . .SS "matcher" . .SS "icon" . .SS "imageTag" . .SS "csrfTag" . .SS "csrfMetaTag" . .SS "metaTag" . .SS "formFor" . .SS "fieldsFor" . .SS "errorMessagesFor" . .SS "formTag" . .SS "formTagBegin" . .SS "formTagEnd" . .SS "labelTag" Accepts two optional arguments: label text and set of html params\. . .SS "inputTag" Accepts single argument \- set of html params: . .IP "" 4 . .nf <%\- inputTag({type: \'password\', name: \'User[password]\'}) %> . .fi . .IP "" 0 . .P will generate: . .IP "" 4 . .nf . .fi . .IP "" 0 . .SS "texteareaTag" Accepts two optional arguments: value and set of html params\. . .IP "" 4 . .nf <%\- texteareaTag(\'Hello World\', {name: \'greeting\'}) %> . .fi . .IP "" 0 . .P will generate: . .IP "" 4 . .nf . .fi . .IP "" 0 . .SS "submitTag" . .SS "buttonTag" . .SS "selectTag" . .SS "optionTag" . .SH "FORM HELPERS" . .SS "begin" . .SS "end" . .SS "label" . .SS "select" . .SS "input" . .SS "file" . .SS "textarea" . .SS "checkbox" . .SS "submit" . .SH "CUSTOM HELPERS" There are two kind of custom helpers: application\-wide and controller\-wide\. Application\-wide helpers defined in \fB\./app/helpers/application_helper\.js\fR file\. Controller\-wide helpers available only for specific controller, and should be defined in \fB\./app/helpers/controllerName_helper\.js\fR file\. . .P Each controller is a javascript file exports set of functions (helper methods)\. These methods available in views and called on controller context, i\.e\. \fBthis\fR keyword inside helper method refers to controller, so that you can access every member available in controller context: \fBreq\fR, \fBres\fR, \fBbody\fR, \fBcompound\fR\. To access view context use \fBthis\.viewContext\fR\. . .SH "SEE ALSO" routing(3)