本文整理汇总了PHP中Flight::clear方法的典型用法代码示例。如果您正苦于以下问题:PHP Flight::clear方法的具体用法?PHP Flight::clear怎么用?PHP Flight::clear使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Flight
的用法示例。
在下文中一共展示了Flight::clear方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: testGetAndSet
function testGetAndSet()
{
Flight::set('a', 1);
$var = Flight::get('a');
$this->assertEquals(1, $var);
Flight::clear();
$vars = Flight::get();
$this->assertEquals(0, count($vars));
Flight::set('a', 1);
Flight::set('b', 2);
$vars = Flight::get();
$this->assertEquals(2, count($vars));
$this->assertEquals(1, $vars['a']);
$this->assertEquals(2, $vars['b']);
}
示例2: Core_GUI
*/
$gui = new Core_GUI($module);
/**
* Javascript Generator
*/
$js = new Core_GUI_JS($module);
/**
* Build Page Header
*/
$gui->getHeader();
/**
* Get Resource ID
*/
if (Flight::has('RESOURCE_ID')) {
$resId = Flight::get('RESOURCE_ID');
Flight::clear('RESOURCE_ID');
} else {
// Bad Request
Flight::redirect('/400');
}
// ===========================================================================================================
/**
* Fetch Resource Model
*/
$dbh = Core_DBH::getDBH();
// Get Database Handle
$sth = $dbh->prepare("\n\tSELECT\n\t\tbox.box_id,\n\t\tos.operating_system,\n\t\tbox.name,\n\t\tbox.notes,\n\t\tbox.steam_lib_path\n\tFROM " . DB_PREFIX . "box AS box\n\tJOIN " . DB_PREFIX . "os AS os\n\t\tON box.os_id = os.os_id\n\tWHERE\n\t\tbox.box_id = :resId\n\t;");
$sth->bindParam(':resId', $resId);
$sth->execute();
$resModel = $sth->fetchAll(PDO::FETCH_ASSOC);
$resModel = $resModel[0];