* $tabs = Widget::create('tabs'); * * * @copyright Copyright (c) 2013 Icinga-Web Team * @author Icinga-Web Team * @license http://www.gnu.org/copyleft/gpl.html GNU General Public License */ class Widget { /** * Create a new widget * * @param string $name Widget name * @param array $options Widget constructor options * * @return AbstractWidget */ public static function create($name, $options = array(), $module_name = null) { $class = 'Icinga\\Web\\Widget\\' . ucfirst($name); if (! class_exists($class)) { throw new ProgrammingError( 'There is no such widget: %s', $name ); } $widget = new $class($options, $module_name); return $widget; } }