-
Notifications
You must be signed in to change notification settings - Fork 1
Built In Helpers
The following list of functions is applicable to the v1 branch. Most of these are methods of the Helper class in v2, accessible via the $helper object in your templates and pages. The Helper class is found in phooey/system/inc/PhooeyHelper.class.php
Phooey has a bunch of built-in functions that act as helpers or template tags. This page documents most of them.
Returns ’ active ’ if $link matches the current url. Returns ’ parent ’ if the current url is a child of $link.
Returns a list of css class names based on the current path separated by spaces.
Returns css link tags based on the css array in the yaml config.
Returns the page’s description based on the description declaration in the yaml config for the meta_tags() helper.
Returns the page’s doctype based on the doctype declaration in the yaml config for the doctype_tag() helper.
Returns the doctype declaration tag.
Returns the GA Javascript code if google_analytics_id is declared in the yaml config. (Otherwise, it returns a blank string.)
Returns links to various Javascript libraries provided by the Google AJAX Libraries API.
Outputs escaped string (do not use echo with this function). It’s a shortcut for echo htmlspecialchars($string);.
Returns the appropriate <html> opening tag depending on the doctype.
Returns true if the given string is an element of the $vars array.
Returns true if the page’s doctype specifies XHTML (used by tag_closer()).
Returns script tags that link to various Javascript files as specified in the js declaration in the yaml config.
Returns the keywords declared in the yaml config.
Returns language declared in the yaml config (or default: en).
Returns the meta tags specified by the meta declaration in the yaml config. See Configuration Options for the defaults.
Returns the name of the page based on the url (the part of the url after the last slash).
Returns an unordered list with sublists depending on the $depth. Pass the $parent path to get subnav. The ul has all sorts of additional features such as ‘active’ class for the active li and a tags, ‘parent’ class for the parent of the current page, etc.
Returns the path to one level above the current url.
An alias for render_page().
Includes a .page file from the content directory.
Includes a .part file from the templates directory.
Returns ’ /’ or an empty string depending on whether or not the doctype is XHTML or HTML.
Returns the page title by combining the site_title with the page title joined with $separator.
Returns the <title> tag containing the value of the title() helper.
Returns true if the specified element of $vars is set to a non-empty value.