Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
Tags
- 야생개복숭아 판매
- 경기북부골프장
- 제주도설경
- 포천수영장
- 괌자유여행
- 덕소골프샵
- 제주도눈
- 한라산
- 돌복숭아
- 개복숭아
- wp-900
- 자연산 개복숭아
- 포천가볼만한곳
- 서원힐스
- 잠실수영장
- 포천온천
- 괌
- 자연산개복숭아
- 제주도눈썰매
- 제주도
- LGG6
- 조경철천문대
- 야생개복숭아
- 개복숭아 판매
- 파주골프장
- 휘닉스파크
- 개복숭아판매
- 태안수영장펜션
- 충주골프장
- 포천투어
Archives
- Today
- Total
Live Brilliant
Codeigniter 쿼리스트링URL 과 세그먼트 URL 혼합 사용 하기 본문
Codeigniter 쿼리스트링URL 과 세그먼트 URL 혼합 사용 하기
1. 세그먼트 기반 접근방식
예: example.com/product/search/test/2
2.쿼리스트링 접근방식
예: example.com/?c=product&m=search&pname=test&pid=2
위 두가지 동시에 사용하는 방법
Option 1: Mixing Globally(전역 적용)
To enable this globally, go to your application/config.php
file, and look for $config['uri_protocol']
variable and change it to:
$config['uri_protocol'] = "PATH_INFO";
$config['enable_query_strings']
variable and change it to:$config['enable_query_strings'] = TRUE;
Your application should now accept both segments and querystrings.
Option 2: Mixing Locally(특정 컨트롤러 적용)
If you don’t want to enable this capability across your whole application, you can restrict it to only the controllers you want.
You can do this by going to the
application/config.php
file and switching $config['enable_query_strings']
back to ‘FALSE’.$config['enable_query_strings'] = FALSE;
$config['uri_protocol']
as PATH_INFO$config['uri_protocol'] = "PATH_INFO";
and then you can add this line to your controller’s contructor method
그리고 해당 컨트롤러 contructor 아래 내용 추가
parse_str($_SERVER['QUERY_STRING'],$_GET);
출처: http://www.tech2grab.com/2011/02/codeigniter-mixing-segment-based-url.html
'개발은 핵찜이야 > codeigniter' 카테고리의 다른 글
코드이그나이터 흐름도 (0) | 2013.03.21 |
---|---|
[codeigniter] 웹에디터 html 사용시 손실 (0) | 2012.09.25 |
Codeigniter base_url vs site_url (0) | 2012.09.21 |
controller 하위폴더 접근 Router 설정 (0) | 2012.08.14 |
codeigniter 폴더구성 및 경로 (0) | 2012.07.30 |
Comments