Function argProg fcf.Arg argProg(object a_options) Returns the template argument calculated by the hook hooksProgramableArgument Source file fcf:fcf.js Namespace fcf Arguments: object a_options - An object containing the parameters of the template argument. List of template arguments:
  • array[string] dependencies - an array of template argument names on which the assembly of the declared argument depends.
  • array[string] hardDependencies - an array of template argument names on which the assembly of the declared argument depends. But unlike dependencies, overloading the argument does not remove this dependency and it is relevant when using hooks
  • bool important - if true, even when the argument is redefined by the render method, the hook hooksProgramableArgument is called, but with the value already filled in in a_taskInfo. args.
Return value: fcf.Arg Examples Example 1

Example of using the fcf.argProg argument

template.tmpl file:

//~ARGUMENTS { value: fcf.argProg() } //~TEMPLATE @{{args.value}}@

template.hooks.js file:

fcf.module({ name: "template.hooks.tmpl", dependencies: [], module: function(){ return { hooksProgramableArgument: { value: (a_taskInfo)=>{ let result = ""; for(let i = 0; i < 5; ++i) result += String.fromCharCode("A".charCodeAt(0) + i); return result; } }, }; } });
Result: ABCDE