我想使用Drupal函數重定向我的自定義url,請幫助我使用哪些函數用於此重寫方法以及此函數的任何代碼片段代碼。如何使用函數重寫Drupal中的url
1
A
回答
0
沒有爲Drupal 7 drupal_goto(),您可以使用剛剛加入一個參數會喜歡這個
drupal_goto($網址,陣列重定向Drupal內部路徑也還有外部鏈接的功能(」外部'=> TRUE));
請對API文檔來看看這個功能
drupal_goto($path = '', array $options = array(), $http_response_code = 302)
說明: $選項:(可選)的附加選項關聯數組包含下列元素:
'query':一組查詢鍵/值對(不包括任何 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_response_code:(可選)HTTP狀態代碼,用來重定向,默認爲302的3xx重定向狀態代碼的有效值在RFC 2616和新的HTTP狀態代碼的定義草案:
301:永久移動(大多數重定向的推薦值)。
302:找到(默認在Drupal和PHP中,有時用於垃圾郵件搜索引擎)。
303:查看其他。
304:未修改。
305:使用代理。
307:臨時重定向。
請讓我知道如果我錯過了任何東西。
相關問題
- 1. Mod重寫問題:用drupal重寫url
- 2. Drupal URL重寫衝突
- 3. 如何使用htaccess重寫函數來隱藏?id = URL?
- 4. 如何在asp.net中使用Url重寫
- 5. jQuery函數URL重寫
- 6. 重寫URL以包含GET數據(使用Drupal)
- 7. 如何使用ASP.NET 4.0 URL重寫來重寫URL?
- 8. 如何使$ _GET函數與重寫的url一起工作?
- 9. 的Drupal的.htaccess與URL重寫規則
- 10. 如何在PHP中重寫url重寫中的單獨參數
- 11. 如何使用onClick編寫或替換函數中的url?
- 12. 如何使drupal函數不區分大小寫在php和javascript中的drupal 7
- 13. Htaccess使用?重寫URL?重複的URL
- 14. 如何用htaccess重寫codeigniter中的URL?
- 15. 使用URL重寫
- 16. 如何用apache重寫url
- 17. 如何用htaccess重寫url?
- 18. 如何用.htaccess重寫URL?
- 19. 如何用1參數重寫url
- 20. 如何使用htaccess重寫URL?
- 21. 如何使用iis url重寫擴展
- 22. 如何使用struts2重寫URL地址?
- 23. 你如何使用htaccess重寫URL?
- 24. 如何使用htaccess重寫URL?
- 25. 如何使用Apache重寫URL
- 26. 如何刪除?action =使用url重寫?
- 27. 如何使用htacces重寫靜態URL
- 28. 如何使用.htaccess文件重寫URL?
- 29. 如何使用PHP重寫URL?
- 30. 如何使用IIRF URL重寫引擎