template::util::get_url_directory (public)

 template::util::get_url_directory url

Defined in packages/acs-templating/tcl/util-procs.tcl

Get the directory portion of a URL. If the URL has a trailing slash, then return the entire URL.

Parameters:
url (required)

Partial Call Graph (max 5 caller/called nodes):
%3 test_get_url_directory get_url_directory (test acs-templating) template::util::get_url_directory template::util::get_url_directory test_get_url_directory->template::util::get_url_directory

Testcases:
get_url_directory
Source code:
    set directory $url

    set lastchar [string range $url [string length $url]-1 end]

    if {$lastchar ne "/" } {

        set directory [file dirname $url]/

        if {$directory eq "//"} {
            # root directory is a special case
            set directory /
        }
    }

    return $directory
XQL Not present:
Generic, PostgreSQL, Oracle
[ hide source ] | [ make this the default ]
Show another procedure: