[Drupal] How to get the real path of a node, no matter it is a path or a url alias
2010-08-23 14:16
841 查看
Just test the code as below:
代码
Have fun!
代码
$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!
相关文章推荐
- How to get value of the person or group type via CAML Query js
- How to check if a journal is EI, SCI, ISI, SCIE or SSCI and get its Impact Factor
- SharePoint 2010 Server Error: The URL "XXX" is invalid, it may refer to a nonexistent file or ...
- How to pass the paramater of Node.js or io.js into native C/C++ function.
- Is it possible to get the difference from two dynamic arrays regardless of their order?
- How to pass the paramater of Node.js or io.js into native C/C++ function.
- Unable to get value of the property '2': object is null or undefined
- http://url is already routed to the Default zone of another application. Remove that mapping or use a different URL
- How To get the Real length of a string with chinese words
- [Drupal 7]How to hide the "URL path settings" fieldset?如何隐藏“URL别名”字段?
- How to get the visible region of a window or CDC(转自http://www.programmersheaven.com)
- Sharepoint Error : The URL "filename" is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web
- This function has none of Deterministic,no sql,or reads sql data in its declaration and binary logging is enabled(you *might* want to use the less safe log_bin_trust_function_creators variable
- Oracle table fragmentation how to calculate or get the actual used blocks of the table
- The URL "filename" is invalid. It may refer to a nonexistent file or folder, or refer to a valid file or folder that is not in the current Web
- VS.NET 2003 Error - The project you are trying to open is a Web project. You need to open it by specifying its URL path.
- How to get a type in C++ when its template argument is the argument
- The Behavior version of the Forest is 0 it must be 2 or greater to perform a domain rename: 该服务器不愿意处理该请求。 :8245
- How to find a node by its text using the GetNodeByText method
- How to get the url of a page in OpenERP?