GetFunctionCalledName()
Returns the name of variable used to call the current function
GetFunctionCalledName( );
Returns: String
This function does not take any arguments.
Examples
yell = function (name){
echo(name);
dump(var=getFunctionCalledName(), label="Function was called as");
};
<span class="nf">yell</span><span class="p">(</span><span class="s2">"yell"</span><span class="p">);</span>
<span class="nv">say</span> <span class="o">=</span> <span class="nv">yell</span><span class="p">;</span> <span class="c">// copy function</span>
<span class="nf">say</span><span class="p">(</span><span class="s2">"say from "</span><span class="p">);</span>
<span class="nv">yell</span> <span class="o">=</span> <span class="nv">say</span><span class="p">;</span> <span class="c">// copy function again</span>
<span class="nf">yell</span><span class="p">(</span><span class="s2">"yell from say"</span><span class="p">);</span>
See also
- Server
- GetBuiltInFunction()
- Search Issue Tracker
- Search Lucee Test Cases (good for further, detailed examples)