1 <?php
2 /**
3 * Button.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 in views to display a button
13 *
14 * @package View\Plugins
15 */
16 class Button extends \Hawk\ViewPlugin{
17 /**
18 * The class attribute to apply to the button
19 *
20 * @var string
21 */
22 public $class = '',
23
24 /**
25 * The icon to display in the button
26 *
27 * @var string
28 */
29 $icon = '',
30
31 /**
32 * The text to display in the button
33 *
34 * @var string
35 */
36 $label = '',
37
38 /**
39 * The other parameters to apply
40 *
41 * @var array
42 */
43 $param = array();
44
45 /**
46 * Display the button
47 *
48 * @return string The html result describing the button
49 */
50 public function display(){
51 return \Hawk\View::make(
52 \Hawk\Theme::getSelected()->getView('button.tpl'), array(
53 'class' => $this->class,
54 'icon' => $this->icon,
55 'label' => $this->label,
56 'param' => $this->params
57 )
58 );
59 }
60 }
61