, 즉 첨부 :
<?php
//application/logmessage/log.phtml//
require_once 'Zend/Log.php';
require_once 'Zend/Log/Writer/Stream.php';
class Logger {
/**
* Array variable store full file back trace information.
*
* @access protected
*/
protected $backTrace = array();
/**
* Array variable store full message information.
*
* @access protected
*/
protected $messageInfo = array();
/**
* Constructor: loads the debug and error logs.
*
*/
public function __construct($type, $msg) {
$mock = new Zend_Log_Writer_Mock;
$logger = new Zend_Log($mock);
$logger->$type($msg);
// Get full message information.
array_push($this->messageInfo, $mock->events[0]);
// Get full information of file, from where the message come.
array_push($this->backTrace, debug_backtrace());
// Set all required informationn in their respective variables.
$messageText = $this->messageInfo[0]["message"];
$priority = $this->messageInfo[0]["priorityName"];
$backTraceFile = $this->backTrace[0][0]["file"];
$backTraceLine = $this->backTrace[0][0]["line"];
$logArray = array("Message" => $messageText, "Priority" => $priority,
"Line" => $backTraceLine, "File" => $backTraceFile);
}
}
?>
지금 내가 양식과 함께 $ logArray 배열을 표시 할을, 내 양식 파일은 같은 것입니다 :
<?php
//application/views/scripts/miscellaneous/index.phtml//
//require_once('../application/logmessage/log.phtml');
echo $this->form;
?>
어떻게 로그 배열을 양식으로 표시 할 수 있습니까 ....?
어떻게 "응용 프로그램/조회/스크립트/기타/index.phtml"나는 http://framework.zend.com/manual/en/zend.registry.html 방문
당신이 설명 할 수 아름다운 사용자 인터페이스를 생성하는 사용자 정의 도우미와
print_r
을 대체하는 것을 잊지 말아? – UpTheCreek