2014-02-24 6 views
1

Drupal 함수를 사용하여 사용자 정의 URL을 리디렉션하고 싶습니다.이 재 작성 메소드와이 코드 스 니펫 코드에 어떤 함수가 사용되는지 알려주십시오. 그냥이함수를 사용하여 Drupal에서 url을 다시 작성하는 방법

drupal_goto ($ URL이, 배열 같은 것 하나 개의 매개 변수를 추가하여 내부 드루팔 경로도뿐만 아니라 외부 URL을 리디렉션하는 데 사용할 수있는 드루팔 7 drupal_goto()에 대한 함수 ('가

답변

0

외부 '=> 참)); $ 옵션 : (선택 사항) 추가 옵션의 연관 배열, 다음과 같은 요소 :

drupal_goto($path = '', array $options = array(), $http_response_code = 302)

설명 기능에 대한

은 API의 문서에 봐주십시오 '검색어': URL에 추가 할 검색어 키/값 쌍 ( URL 인코딩 없음)의 배열입니다.

'fragment': A fragment identifier (named anchor) to append to the 
URL. Do not include the leading '#' character. 

'absolute': Defaults to FALSE. Whether to force the output to be an 
absolute link (beginning with http:). Useful for links that will be 
displayed outside the site, such as in an RSS feed. 

'alias': Defaults to FALSE. Whether the given path is a URL alias 
already. 

'external': Whether the given path is an external URL. 

'language': An optional language object. If the path being linked to 
is internal to the site, $options['language'] is used to look up the 
alias for the URL. If $options['language'] is omitted, the global 
$language_url will be used. 

'https': Whether this URL should point to a secure location. If not 
defined, the current scheme is used, so the user stays on HTTP or 
HTTPS respectively. TRUE enforces HTTPS and FALSE enforces HTTP, but 
HTTPS can only be enforced when the variable 'https' is set to TRUE. 

'base_url': Only used internally, to modify the base URL when a 
language dependent URL requires so. 

'prefix': Only used internally, to modify the path when a language 
dependent URL requires so. 

'script': The script filename in Drupal's root directory to use when 
clean URLs are disabled, such as 'index.php'. Defaults to an empty 
string, as most modern web servers automatically find 'index.php'. 
If clean URLs are disabled, the value of $path is appended as query 
parameter 'q' to $options['script'] in the returned URL. When 
deploying Drupal on a web server that cannot be configured to 
automatically find index.php, then hook_url_outbound_alter() can be 
implemented to force this value to 'index.php'. 

'entity_type': The entity type of the object that called url(). Only 
set if url() is invoked by entity_uri(). 

'entity': The entity object (such as a node) for which the URL is 
being generated. Only set if url() is invoked by entity_uri(). 

$의적인 http_resopnse_code : (옵션) 리디렉션에 사용하는 HTTP 상태 코드, 302 기본값 3xx의 리디렉션 상태 코드에 대한 유효한 값은 RFC 2616 및 새로운 HTTP 상태 코드 초안에 정의되어 있습니다 :

301 : Moved Permanently (대부분의 리디렉션에서 권장 값).

302 : Found (스팸 검색 엔진에 사용되는 Drupal 및 PHP의 기본값).

303 : 기타를 참조하십시오.

304 : 수정되지 않음.

305 : 프록시를 사용하십시오.

307 : 임시 리디렉션.

내가 무엇이든 놓친다면 알려주세요.

관련 문제