-
Notifications
You must be signed in to change notification settings - Fork 33
/
EBootstrapHero.php
59 lines (49 loc) · 1.08 KB
/
EBootstrapHero.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<?php
/**
* Render a hero element
* http://twitter.github.com/bootstrap/examples/hero.html
*
* @author Tim Helfensdörfer <[email protected]>
* @version 0.3.0
* @package bootstrap.widgets
*/
class EBootstrapHero extends EBootstrapWidget {
/**
* Headline
*/
public $headline = '';
/**
* Body text
*/
public $body = '';
/**
* Array of actions which will be displayed below the body
*/
public $actions = array();
/**
* Init the widget
*/
public function init() {
parent::init();
EBootstrap::mergeClass($this->htmlOptions, array('hero-unit'));
}
/**
* Render the hero element
*/
public function run() {
parent::run();
echo EBootstrap::openTag('div', $this->htmlOptions)."\n";
echo EBootstrap::tag('h1', array(), $this->headline)."\n";
echo EBootstrap::tag('div', array(), $this->body)."\n";
if (!empty($this->actions)) {
echo EBootstrap::openTag('p');
foreach ($this->actions as $button) {
echo $button." \n";
}
echo "\n";
echo EBootstrap::closeTag('p')."\n";
}
echo EBootstrap::closeTag('div')."\n";
}
}
?>