You are here

function swftools_json_params in SWF Tools 6.3

Same name and namespace in other branches
  1. 5 swftools.module \swftools_json_params()
  2. 6 swftools.module \swftools_json_params()
  3. 6.2 swftools.module \swftools_json_params()

Converts an array of paramters to JSON and returns them as a string ready for use as a flashvar.

Parameters

array $params: An array of parameters.

string $attribute: The attribute that the JSON string will be attached to.

Return value

string A string in the form [attr]={JSON}

File

./swftools.module, line 570
The primary component of SWF Tools that enables comprehensive media handling.

Code

function swftools_json_params(&$params, $attribute = 'swftools') {
  return $attribute . "='" . drupal_to_js($params) . "'";
}