반응형
404 페이지에 back버튼 달기
출처: http://codeigniter-kr.org/bbs/view/qna?idx=9227
application/errors/ 디렉토리안의 error_404.php 파일에 back 버튼 달아보세요.
팁게시판 보시면 ci사랑님이 올려놓으신 alert helper가 있을겁니다.
그게 원하시는 역할을 해주는 헬퍼입니다.
//application/helpers/alert_helper.php<? if ( ! defined('BASEPATH')) exit('No direct script access allowed');// 경고메세지를 경고창으로function alert($msg='', $url='') { $CI =& get_instance(); if (!$msg) $msg = '올바른 방법으로 이용해 주십시오.'; echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=".$CI->config->item('charset')."\">"; echo "<script type='text/javascript'>alert('".$msg."');"; if ($url) echo "location.replace('".$url."');"; else echo "history.go(-1);"; echo "</script>"; exit;}// 경고메세지 출력후 창을 닫음function alert_close($msg) { $CI =& get_instance(); echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=".$CI->config->item('charset')."\">"; echo "<script type='text/javascript'> alert('".$msg."'); window.close(); </script>"; exit;}// 경고메세지만 출력function alert_only($msg) { $CI =& get_instance(); echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=".$CI->config->item('charset')."\">"; echo "<script type='text/javascript'> alert('".$msg."'); </script>"; exit;}function alert_continue($msg){ $CI =& get_instance(); echo "<meta http-equiv=\"content-type\" content=\"text/html; charset=".$CI->config->item('charset')."\">"; echo "<script type='text/javascript'> alert('".$msg."'); </script>"; }?> |
반응형
'WEB언어 > CodeIgniter' 카테고리의 다른 글
| CodeIgnite 에러 로그 보기 설정 (0) | 2019.01.26 |
|---|---|
| CodeIgniter 컨트롤에서 다른 컨트롤 사용하기 (0) | 2018.03.27 |
| CodeIgniter 세션 클래스 (0) | 2018.03.24 |
| CodeIgniter 동영상 수업 (0) | 2018.03.15 |
| CodeIgniter .htaccess 및 URL변경 (0) | 2018.03.10 |
| CodeIgniter Multiple file 업로드 하기 (0) | 2018.03.09 |
| CodeIgniter file delete와 download (0) | 2018.03.09 |
도움이 되셨다면 하트모양의 "♡ 공감"을 눌러주시면 큰 격려가 됩니다.
(로그인하지 않으셔도 가능)
(로그인하지 않으셔도 가능)