common

View-related functions

Summary

The common function loads a script, optionally passing in some variables. Themes and plugins can use this function to separate distinct blocks of output into different scripts, even if all the output will appear on one page.

By default, common tries to load the script from the “common” directory for the current theme, but any view directory can be specified.

common(string $file, array $vars = Array, string $dir = common)

Return HTML from a file in the common/ directory, passing variables into that script.

Parameters:
  • $file (string) – Filename
  • $vars (array) – A keyed array of variables to be extracted into the script
  • $dir (string) – Defaults to ‘common’
Returns:

string

Usage

Examples

See Also