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

Wolf provides a simple “previous” and ”next” function. previous returns an array of values relating to the page preceding the current page, if it exists.1) It is thus not used on its own, but normally would be used in the Layout to provide a link to the “preceding” page.


The following code tests to see if a “previous” page exists. If it does, it makes a link accompanied by a label with a double-arrow pointing left:

<?php if ($previous = $this->previous()): ?>
  <div style="float: left; border-top: thin solid #ccc; padding-top: 4px;"><?php echo $previous->link(); ?> &#171; Previous</div>
<?php endif; ?>

See also next.

1) Consult the documentation on this to find out what the “current” page is in different situations.
functions/previous.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