1200字范文,内容丰富有趣,写作的好帮手!
1200字范文 > [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

时间:2023-07-04 16:11:37

相关推荐

[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!

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。