Light-weight, fast, simple and powerful!
Translations of this page?:


Wolf uses some “constants” which can be useful for site development:1)


URL_PUBLIC returns the homepage URL of the Wolf website in the format (with trailing slash). It is used throughout the default Layouts to provide a dynamic reference to the website. For example, the favicon is called in the Simple layout with this code:

  <link rel="favourites icon" href="<?php echo URL_PUBLIC; ?>favicon.ico" />


URI_PUBLIC returns the home location of the Wolf website. This makes it possible to pass a reference relative to the location of Wolf's index page. If Wolf's index.php lives in the root directory (e.g.,, then echo URI_PUBLIC will simply return /. If it lives in a subdirectory (e.g., then echo URI_PUBLIC will return the root directory like this: /wolfcms/


BASE_URL is closely related to URL_PUBLIC, and when USE_MOD_REWRITE is set to “true” in config.php, they are identical. However, when USE_MOD_REWRITE is set to “false”, BASE_URL will include the ? in the URI.

In the default sidebar to the Home Page, the RSS feed link is given this way:

  <a href="<?php echo BASE_URL; ?>rss.xml">Articles RSS Feed</a>


Echoing CURRENT_URI will return the part of the current URL following the URI_PUBLIC (see above), ignoring any page suffixes. Examples:

Full URL URI_PUBLIC CURRENT_URI / about_us /wolf/ about_us /wolf/ about_us /grocers-site/ fruit/oranges / articles/2009/07/24/my_second_article


The CMS_ROOT contstant returns the file path of the server to the directory where Wolf is installed. If you installed Wolf to the htdocs root directory of your site, this code:

<?php echo CMS_ROOT; ?>

would return a value something like:


1) There is a yet more full list of constants provided with the Plugin documentation, but without some of the discussion given here.
functions/constants.txt · Last modified: 2011-09-12 00:46 (external edit)
Except where otherwise noted, content on this wiki is licensed under the following license:GNU Free Documentation License 1.2
Copyright 2010 / design by yello studio / Wolf CMS Inside