General
Getting & Giving Support
Administration
Design
- Tut. - Layouts and Themes
- Tut. - Navigation cookbook
- Tut. - How To section
Reference Material
Plugin Development
- Tut. - Writing a plugin
- Ref. - List of Events
- Ref. - Enabling cron jobs
- Ref. - PHPDoc
Core Development
- Ref. - PHPDoc
Press information
Wolf CMS books section
link()
The link() function by default produces the title of the current page wrapped in HTML hyperlink tags.1) For example, in an out-of-the-box Wolf install, for the “About Us” page, this code:
<?php echo $this->link(); ?>
produces:
<a href="http://www.mywolfsite.com/about_us">About us</a>
Arguments
link() can take two arguments: the first to give the title for the link (so overriding the default page title), the second can be used for other link parameters.
See also: linkById()
Examples
1. Link with different text
Assuming that “About Us” is still the “current” page, then this code:
<?php echo $this->link('Click here!'); ?>
will produce this link:
<a href="http://www.mywolfsite.com/about_us">Click here!</a>
2. Link with Title text, adding parameter
To retain the default title, but add a further parameter, this code:
<?php echo $this->link($this->title, ' class="info"'); ?>
will produce this link:
<a href="http://www.mywolfsite.com/about_us" class="info">About us</a>
To produce links of pages other than the current one, see the "find" function.
