1 <?php
2 /**
3 * Widget.php
4 *
5 * @author Elvyrra SAS
6 * @license http://rem.mit-license.org/ MIT
7 */
8
9 namespace Hawk\View\Plugins;
10
11 /**
12 * This class is used to display a widget in a view
13 *
14 * @package View\Plugins
15 */
16 class Widget extends \Hawk\ViewPlugin{
17
18 /**
19 * The classname of the widget
20 *
21 * @var string
22 */
23 public $class;
24
25 /**
26 * Display the widget
27 *
28 * @return string The displayed HTML
29 */
30 public function display(){
31 $classname = $this->class;
32 $component = new $classname($this->params);
33 return $component->display();
34 }
35 }
36