Back to Sidebar class

Method addFilter

public static void
addFilter
(mixed $label, mixed $name, mixed $options, mixed $noDefault = false)
Method to add a filter to the submenu
Parameters
  • string $label Label for the menu item.
  • string $name Name for the filter. Also used as id.
  • string $options Options for the select field.
  • bool $noDefault Don't show the label as the empty option
Returns
  • void
Since
  • 3.0
Class: Sidebar
Project: Joomla

Method addFilter - Source code

/**
 * Method to add a filter to the submenu
 *
 * @param   string  $label      Label for the menu item.
 * @param   string  $name       Name for the filter. Also used as id.
 * @param   string  $options    Options for the select field.
 * @param   bool    $noDefault  Don't show the label as the empty option
 *
 * @return  void
 *
 * @since   3.0
 */
public static function addFilter($label, $name, $options, $noDefault = false)
{
    static::$filters[] = array('label' => $label, 'name' => $name, 'options' => $options, 'noDefault' => $noDefault);
}