답변 2개
채택된 답변
+20 포인트
5개월 전
다음 코드가 도움이 될지 모르겠습니다.
Copy
<?php
include 'common.php';
function hook_fn_0() {
print('<fieldset>');
print('<legend>' . __FUNCTION__ . '</legend>');
print('</fieldset>');
}
function hook_fn_2($arg1, $arg2) {
print('<fieldset>');
print('<legend>' . __FUNCTION__ . '</legend>');
print('<pre>');
print_r(func_get_args());
print('</pre>');
print('</fieldset>');
}
add_event('foo_0', 'hook_fn_0', G5_HOOK_DEFAULT_PRIORITY, 0);
add_event('foo_2', 'hook_fn_2', G5_HOOK_DEFAULT_PRIORITY, 2);
run_event('foo_0');
run_event('foo_2', 1, 'a');
?>
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
마르스컴퍼니
5개월 전
HOOK 을 세팅해 두는 파일은 없는 것으로 알고 있습니다.
백지로 나온다면 PHP 에러 가능성이 높으니
에러 내용부터 확인해 보는 것이 좋습니다. (에러 출력 X 설정인 경우)
ini_set('display_errors', 1);
error_reporting(E_ALL);
다음으로 참고해 볼 수 있는 사항은,
add_event() 가 먼저 수행되고,
run_event() 가 나중에 수행되어야 한다는 점입니다.
로그인 후 평가할 수 있습니다
댓글을 작성하려면 로그인이 필요합니다.
답변을 작성하려면 로그인이 필요합니다.
로그인