2012-12-15 2 views
1

오류를 제공하지만 URL은 . or() or - or any other special characterURL 매개 변수 값은 내가 SEO 친화적 인 URL을 제공하는 URL 관리자를 편집 한보기

http://localhost/nbnd/search/city/delhi 

In city action 
var_dump($_GET); 

output: array(1) { ["city"]=> string(6) "delhi" } 

but when url is with some special character 
http://localhost/nbnd/search/city/north-delhi or 
http://localhost/nbnd/search/city/north.delhi or 
http://localhost/nbnd/search/city/(north)delhi 

In city action 
var_dump($_GET); 

Output : array(1) { ["north-delhi"]=> string(0) "" } 
and so for other 

배열 값의 변화와 같은 특수 문자가 포함 된 값을 가질 때 문제를 얻고있다 오류가 발생합니다. 당신은 문자의 모든 종류의 원하는대로

+0

허용 할 문자는 무엇입니까? –

+0

@ bool.dev 나는 그것들이 기본 URL로 일찍 일하고 싶지만 SEO 형식의 URL에서는 작동하지 않는다. –

답변

2

, 관련 question/answer에서 규칙을 변경 :

'<controller:\w+>/<action:\w+>/<city>'=>'<controller>/<action>', 
// omit the pattern \w+ from city:\w+ 

Documentation :

ParamPattern가 생략되는 경우

,이 매개 변수는 모든 문자와 일치해야 의미 슬래시 /를 제외하고.