Reference 〉Function

Helipad.param( str|tuple param, str|bool|num|list[str] val = None )

Sets or gets a parameter. Note the parameter must have been previously registered with model.addParameter(), model.addBreedParam(), or model.addGoodParameter().

Parameters

  • param str|tuple, required

    A parameter identification string or tuple. A string value indicates a global parameter. Per-good parameters can be indicated with a three-item tuple, ('paramName', 'good', 'goodName'). A per-breed parameter can be indicated with a three- or four-item tuple, ('paramName', 'breed', 'breedName', 'primitive'), with the last element optional if there is only one primitive.

    If only this argument is set, the function returns the value of the named parameter.

    Parameter values for all goods or breeds can be retrieved, but not set, with a two-item tuple (e.g. ('name', 'good')). This will return a dict of all item values for the parameter if val is not set, but will throw an exception if val is set.

  • val str|bool|num|list[str], optional

    If this argument is set, the function sets the value of the parameter to val. The data type must be appropriate to the parameter type: a slider takes a number, a menu takes a string, a checkbox takes a bool, a checkentry takes a bool, a string, or an int, depending on the type, and a checkgrid takes a list of strings.

    Default value: None

Return Value str|bool|num|dict|None

If val is not set, returns the parameter value: a string if the parameter is a menu, a boolean if a checkbox, a number if a slider, a bool, int, or string if a checkentry, or a list of strings if a checkgrid. If a two-item tuple is passed for param without specifying an item, the function returns a dict with parameter values for all relevant items. If val is set, the function sets the parameter to val and does not return a value.


Fatal error: Uncaught TypeError: Unsupported operand types: string - string in /home/dh_nzhxm7/helipad.dev/wp-content/themes/propeller/functions.php:200 Stack trace: #0 [internal function]: {closure}(Object(WP_Comment), Object(WP_Comment)) #1 /home/dh_nzhxm7/helipad.dev/wp-content/themes/propeller/functions.php(200): usort(Array, Object(Closure)) #2 /home/dh_nzhxm7/helipad.dev/wp-includes/class-wp-hook.php(294): {closure}(Array) #3 /home/dh_nzhxm7/helipad.dev/wp-includes/plugin.php(212): WP_Hook->apply_filters(Array, Array) #4 /home/dh_nzhxm7/helipad.dev/wp-includes/comment-template.php(1518): apply_filters('comments_array', Array, 110) #5 /home/dh_nzhxm7/helipad.dev/wp-content/themes/propeller/single-hook.php(64): comments_template() #6 /home/dh_nzhxm7/helipad.dev/wp-includes/template-loader.php(106): include('/home/dh_nzhxm7...') #7 /home/dh_nzhxm7/helipad.dev/wp-blog-header.php(19): require_once('/home/dh_nzhxm7...') #8 /home/dh_nzhxm7/helipad.dev/index.php(17): require('/home/dh_nzhxm7...') #9 {main} thrown in /home/dh_nzhxm7/helipad.dev/wp-content/themes/propeller/functions.php on line 200