本文整理汇总了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));
}