Back to FileLayout class

Method addIncludePaths

public self
addIncludePaths
(mixed $paths)
Add one or more paths to include in layout search
Parameters
  • string|string[] $paths The path or array of paths to search for layouts
Returns
  • self
Since
  • 3.2
Class: FileLayout
Project: Joomla

Method addIncludePaths - Source code

/**
 * Add one or more paths to include in layout search
 *
 * @param   string|string[]  $paths  The path or array of paths to search for layouts
 *
 * @return  self
 *
 * @since   3.2
 */
public function addIncludePaths($paths)
{
    if (empty($paths)) {
        return $this;
    }
    $includePaths = $this->getIncludePaths();
    if (\is_array($paths)) {
        $includePaths = array_unique(array_merge($paths, $includePaths));
    } else {
        array_unshift($includePaths, $paths);
    }
    $this->setIncludePaths($includePaths);
    return $this;
}