本文整理汇总了PHP中AppController::log_entry方法的典型用法代码示例。如果您正苦于以下问题:PHP AppController::log_entry方法的具体用法?PHP AppController::log_entry怎么用?PHP AppController::log_entry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AppController
的用法示例。
在下文中一共展示了AppController::log_entry方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sample_page
public function sample_page($id)
{
$session = $this->Session->read();
$this->MorphChartProblem->setEncryptionKey($session['cryptkey']);
$this->MorphChartSolution->setEncryptionKey($session['cryptkey']);
// retrieve the user session and set it to a variable accessible in the view
$UserSession = $this->UserSession->findById($id);
parent::log_entry($UserSession['UserSession']['id'], "Loaded sample page");
$this->set(compact('UserSession'));
// this is for JSON and XML requests.
$this->set('_serialize', array('UserSession'));
}
示例2: delete
public function delete($id)
{
// find the partial ordering
$po = $this->PartialOrdering->findById($id);
// extract information for log output
$pid = $po['PartialOrdering']['id'];
$pmap_id = $po['PartialOrdering']['problem_map_id'];
$eid = $po['PartialOrdering']['entity_id'];
$type = $po['PartialOrdering']['type'];
$oeid = $po['PartialOrdering']['other_entity_id'];
// check if deleted successfully
if ($this->PartialOrdering->delete($id)) {
$message = 'Deleted';
// write output to log file
parent::log_entry($pmap_id, "Added partial_ordering(" . $pid . ", " . $eid . ", " . $type . ", " . $oeid . ")");
} else {
$message = 'Error';
}
// set view variable
$this->set(compact("message"));
// set output for JSON and XML
$this->set('_serialize', array('message'));
}