本文整理匯總了PHP中PMA_getJsValue函數的典型用法代碼示例。如果您正苦於以下問題:PHP PMA_getJsValue函數的具體用法?PHP PMA_getJsValue怎麽用?PHP PMA_getJsValue使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了PMA_getJsValue函數的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: testFormat
/**
* Test for PMA_getJsValue
*
* @param string $key Key
* @param string $value Value
* @param string $expected Expected output
*
* @dataProvider variables
*
* @return void
*/
public function testFormat($key, $value, $expected)
{
$this->assertEquals($expected, PMA_getJsValue($key, $value));
$this->assertEquals('foo = 100', PMA_getJsValue('foo', '100', false));
$array = array('1', '2', '3');
$this->assertEquals("foo = [\"1\",\"2\",\"3\",];\n", PMA_getJsValue('foo', $array));
}
示例2: PMA_addJSVar
/**
* Adds JS code snippet for variable assignment
* to be displayed by the PMA_Response class.
*
* @param string $key Name of value to set
* @param mixed $value Value to set, can be either string or array of strings
* @param bool $escape Whether to escape value or keep it as it is
* (for inclusion of js code)
*
* @return void
*/
function PMA_addJSVar($key, $value, $escape = true)
{
PMA_addJSCode(PMA_getJsValue($key, $value, $escape));
}
示例3: PMA_printJsValue
/**
* Prints an javascript assignment with proper escaping of a value
* and support for assigning array of strings.
*
* @param string $key Name of value to set
* @param mixed $value Value to set, can be either string or array of strings
*
* @return void
*/
function PMA_printJsValue($key, $value)
{
echo PMA_getJsValue($key, $value);
}
示例4: testFormat
/**
* @dataProvider variables
*/
public function testFormat($key, $value, $expected)
{
$this->assertEquals($expected, PMA_getJsValue($key, $value));
}