Back to HtmlView class

Method loadHelper

public void
loadHelper
(mixed $hlp = null)
Load a helper file
Parameters
  • string $hlp The name of the helper source file automatically searches the helper paths and compiles as needed.
Returns
  • void
Since
  • 3.0
Class: HtmlView
Project: Joomla

Method loadHelper - Source code

/**
 * Load a helper file
 *
 * @param   string  $hlp  The name of the helper source file automatically searches the helper paths and compiles as needed.
 *
 * @return  void
 *
 * @since   3.0
 */
public function loadHelper($hlp = null)
{
    // Clean the file name
    $file = preg_replace('/[^A-Z0-9_\\.-]/i', '', $hlp);
    // Load the template script
    $helper = Path::find($this->_path['helper'], $this->_createFileName('helper', array('name' => $file)));
    if ($helper != false) {
        // Include the requested template filename in the local scope
        include_once $helper;
    }
}