Components (CFCs)

Functions

  • ComponentCacheClear() flush the component path cache
  • ComponentCacheList() list elements in the component path cache
  • CreateObject() The CreateObject function takes different arguments depending on the value of the first argument:
  • GetComponentMetaData() Gets metadata (such as the functions and implemented interfaces of a component) for a CFC or Interface.
  • GetComponentStaticScope() returns the static scope of a specific component, of course access rules apply.
  • GetMetadata() Returns back meta information depending on the object passed in
  • IsClosure() checks if given Object is a closure or not.
  • IsCustomFunction() Determines whether a name represents a custom function
  • IsInstanceOf() Determines whether an object is an instance of a Lucee interface or component, or of a Java class.
  • IsValid() Tests whether a value meets a validation or data type rule.

Tags

  • <cfargument> Allows subtag data to be saved with the base tag. Applies only to custom tags.
  • <cfcomponent> Creates and defines a component object
  • <cffunction> Defines a function within a CFML component that can accept arguments and return a value.
  • <cfinterface> Defines an interface that consists of a set of signatures for functions.
  • <cfinvoke> Invokes component methods from within a page or component. You use this tag to reference a WSDL file and consume a web service from within a block of CFML code.
  • <cfinvokeargument> Argument for the Invoke Tag
  • <cfobject> Lets you call methods in COM, CORBA, and JAVA objects.
  • <cfreturn> Returns result values from a component method. Contains an expression returned as result of the function.
  • <cfstatic> defines a static constructor within components

Guides

  • Access Modifiers for variables public and private scope for component variables
  • Implicit Conversion Functions Following up with Magic Functions - Implicit Component Getters / Setters , there's one more gem. Again, this has been around since Lucee 2. We're going to make a new, yet similar example. This time, we're going to create an address object: address.cfc ```lucee #getStreet1()# #getCity()#, #getState()# #getPostalCode()# ``` *index
  • Inline Components Learn how to create and use inline components in Lucee. This guide demonstrates how to define components directly within your CFML code, making it easier to create and use components without needing a separate .cfc file. Examples include creating an inline component and using it similarly to closures.
  • Magic Functions - Implicit Component Getters / Setters ### Enabling Magic Functions via Admin ### You can enable magic functions in the web / server context by going to: http://{your host name}/lucee/admin/web.cfm?action=resources.component - Local web context http://{your host name}/lucee/admin/server.cfm?action=resources.component - Global web context Enable the setting: `Implicit notation` **The Code** Once, you've checked and enabled it, we're ready to start with some code
  • Static scope in components Static scope in components is needed to create an instance of cfc and call its method.
  • Sub Components Learn how to create and use sub components in Lucee. This guide demonstrates how to define additional components within a .cfc file, making it easier to organize related components. Examples include creating a main component with sub components, and how to address/load these sub components.

See also