Page URL. How to get it?

Do you need to get the URL of the current page? Okay, let us look at this action with a small example.

Source Code

Please paste any of these code snippets into your template to see how it works.

Let's experiment with a template like tiny.news.feed/Themes/default/404.tpl by pasting that code into it and then opening some non-existent page associated with this template.

<?php
    $TEST = mimimiUri(FALSE);
    echo 'The relative page URL is ' . $TEST;
?>

Note that we are used above one of the core routines to retrieve URL path. If you are interested in its algorithm, please see the mimimi.core/Routines.php file.

Way 2

<?php
    $TEST = mimimiSite(FALSE) .
            mimimiRoot(FALSE) .
            mimimiUri(FALSE);
    echo 'The absolute page URL is ' . $TEST;
?>

Note that we are used above 3 core routines to assemble URL from its parts. If you are interested in their algorithmes, please see the mimimi.core/Routines.php file.

Way 3

<?php
    $TEST = printPageUrl(FALSE);
    echo 'The absolute page URL is ' . $TEST;
?>

Note that we are used above one of the helper routines to get all URL parts at once. Its algorithm look at the basic Helper module, that is mimimi.modules/Helper/Helper.php file.

Remark

If you want to program specific helper routines to be used in website templates, you can do it anywhere. For example, open local Helper module to see how another routines has been programmed.

* This page is a demo post to display a page content for testers. You need delete this page when you launch website in production mode.