Documentation

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

url()

The url() function gives access to the URL of the current page. It does not take any parameters. If, for example, the current page was the “Articles” page, then

<?php echo $this->url(); ?>

returns the value:

http://mywolfsite.com/articles

See also: urlById()

Usage notes

URLs of pages that are not current

To return the URL of a page that is not current, use the find function. This code:

<?php echo $this->find('articles')->url(); ?>

returns http://mywolfsite.com/articles from anywhere in the site.

Creating links

Although url() can of course be used for creating links, there is a specialized function that is normally the preferred way of doing this: see the documentation on the link() function.

 
functions/url.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 wolfcms.org / design by yello studio / Wolf CMS Inside