[Drupal] How to get the real path of a node, no matter it is a path or a url alias
生活随笔
收集整理的這篇文章主要介紹了
[Drupal] How to get the real path of a node, no matter it is a path or a url alias
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
Just test the code as below:
?
代碼 $uri = substr(request_uri(), 1, strlen(request_uri()));
$uri_array = array();
if(!($path = drupal_lookup_path('source', $uri))) {
$uri_array = explode('/', $uri);
}
else {
$uri_array = explode('/', $path);
}
var_dump($uri_array);
?
Have fun!
總結
以上是生活随笔為你收集整理的[Drupal] How to get the real path of a node, no matter it is a path or a url alias的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 数据库SQL ServerSQL Ser
- 下一篇: STL 容器和迭代器连载6_顺序容器的操