3 namespace Custom\View\Helper;
5 use Zend\View\Helper\AbstractHelper;
7 class Format extends AbstractHelper
10 protected $text = null;
12 public function __invoke($text = null, $format = null)
15 if (null === $text || null === $format) {
19 case 'strong': return $this->strong();
20 case 'em': return $this->em();
21 case 'info': return $this->info();
22 case 'warning': return $this->warning();
23 case 'error': return $this->error();
24 default: return $text;
28 public function strong($text = null)
33 return "<strong>{$text}</strong>";
36 public function em($text = null)
41 return "<strong>{$text}</strong>";
44 public function info($text = null)
49 return '<div class="alert-info">' . $text . '</div>';
53 public function warning($text = null)
58 return '<div class="alert-warning">' . $text . '</div>';
62 public function error($text = null)
67 return '<div class="alert-error">' . $text . '</div>';