本文整理汇总了PHP中Psc\Code\Code::dvalue方法的典型用法代码示例。如果您正苦于以下问题:PHP Code::dvalue方法的具体用法?PHP Code::dvalue怎么用?PHP Code::dvalue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Psc\Code\Code
的用法示例。
在下文中一共展示了Code::dvalue方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __construct
public function __construct($exportFile, $exportType = 'xlsx')
{
$this->exportType = Code::dvalue($exportType, 'xlsx', 'xls');
$this->exportFile = new File($exportFile);
$this->excel = new PHPExcel();
$this->excel->removeSheetByIndex(0);
}
示例2: testDValue
public function testDValue()
{
$value = 'eins';
$this->assertEquals('eins', Code::dvalue($value, 'eins', 'zwei', 'drei'));
$this->assertEquals('eins', $value);
// value as before
$value = NULL;
$this->assertEquals('eins', Code::dvalue($value, 'eins', 'zwei', 'drei'));
$this->assertEquals('eins', $value);
// modified
$value = 'notexistent';
$this->assertEquals('eins', Code::dvalue($value, 'eins', 'zwei', 'drei'));
$this->assertEquals('eins', $value);
// modified
$value = 'zwei';
$this->assertEquals('zwei', Code::dvalue($value, 'eins', 'zwei', 'drei'));
$this->assertEquals('zwei', $value);
// value as before
$value = 'drei';
$this->assertEquals('drei', Code::dvalue($value, 'eins', 'zwei', 'drei'));
$this->assertEquals('drei', $value);
// value as before
}