webCOMAND

#RETURN

Stop execution of the current cTemplate and return a value from the current scope.  By default, if no #RETURN is explicitly called, any text output produced in the current scope will be returned.  #RETURN will override that default behavior and explicitly return a value.

Prototype

#RETURN($value)

Parameters

  • value - the value to return, which may be any type, including bool, int, string, etc.

Example

#IF(!$valid)
    #RETURN(false)
#ENDIF
#RETURN(true)

Related

#BREAK