Skip to content

Instantly share code, notes, and snippets.

@roryl
Created April 22, 2016 12:07
Show Gist options
  • Save roryl/e310ceab4866e75ae923861f5381d8b9 to your computer and use it in GitHub Desktop.
Save roryl/e310ceab4866e75ae923861f5381d8b9 to your computer and use it in GitHub Desktop.
Lucee Custom Tag Imports
component {
/**
* Invoked during the start of the custom tag
* @param {struct} required struct attributes The attributes passed to the custom tag
* @param {struct} required struct caller A reference to the variables scope from the location that calls the custom tag
* @return {boolean} To control whether to execute the body of the custom tag
*/
public boolean function onStartTag(required struct attributes, required struct caller){
param name="attributes.firstName";
param name="attributes.lastName";
writeOutput("<p>Good Day #attributes.FirstName# #attributes.lastName#, </p>");
writeOutput("<p>The time is #timeFormat(now(), "hh:mm tt")#</p>");
return false;
}
/**
* Invoked after the completion of the closing tag
* @param {struct} required struct attributes The attributes passed to the custom tag
* @param {struct} required struct caller A reference to the variables scope from the location that calls the custom tag
* @param {string} string output The output generated between the start and end tags at the caller
* @return {boolean} To control whether to execute the body of the custom tag
*/
public boolean function onEndTag(required struct attributes, required struct caller, string output){
return false;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment