1: <?php
2: /**
3: * Copyright (c) CMNWorks
4: *
5: * Licensed under The MIT License
6: * For full copyright and license information, please see the LICENSE.txt
7: * Redistributions of files must retain the above copyright notice.
8: *
9: * @copyright Copyright (c) CMNWorks Christopher M. Natan
10: * @author Christopher M. Natan
11: * @link http://cmnworks.com
12: * @since 1.8.8
13: * @license http://www.opensource.org/licenses/mit-license.php MIT License
14: */
15: namespace Cakestrap\View\Helper;
16:
17: /**
18: * Easily highlight new or unread items by adding a
19: * Badge helper to links, Bootstrap navs, and more.
20: *
21: * <code>
22: * <?php
23: * echo $this->Cakestrap->Badge()->content("New")->set()
24: * ?>
25: * </code>
26: *
27: * @method content(string $content)
28: *
29: * @package Cakestrap\View\Helper
30: * @link http://getbootstrap.com/components/#badges
31: */
32: class BadgeHelper extends Basic
33: {
34: /**
35: * Set all defined values.
36: * This will return the final html template.
37: *
38: * @return string
39: */
40: public function set()
41: {
42: $container = $this->_stringTemplate->format('container', [
43: 'container' => $this->content
44: ]);
45:
46: return $container;
47: }
48: }