From: Sébastien CHAZALLET Date: Sun, 18 Nov 2012 18:36:10 +0000 (+0100) Subject: Rajout d'une aide de vue X-Git-Url: http://git.inspyration.org/?p=zf2.biz%2Fgalerie.git;a=commitdiff_plain;h=1cdd38eb5dc9d610d21734fefb273196e6f53d30 Rajout d'une aide de vue --- diff --git a/vendor/zf2biz/Custom/View/Helper/Format.php b/vendor/zf2biz/Custom/View/Helper/Format.php new file mode 100644 index 0000000..abf634a --- /dev/null +++ b/vendor/zf2biz/Custom/View/Helper/Format.php @@ -0,0 +1,70 @@ +text = $text; + if (null === $text || null === $format) { + return $this; + } + switch ($format) { + case 'strong': return $this->strong(); + case 'em': return $this->em(); + case 'info': return $this->info(); + case 'warning': return $this->warning(); + case 'error': return $this->error(); + default: return $text; + } + } + + public function strong($text = null) + { + if (null === $text) { + $text = $this->text; + } + return "{$text}"; + } + + public function em($text = null) + { + if (null === $text) { + $text = $this->text; + } + return "{$text}"; + } + + public function info($text = null) + { + if (null === $text) { + $text = $this->text; + } + return '
' . $text . '
'; + } + + + public function warning($text = null) + { + if (null === $text) { + $text = $this->text; + } + return '
' . $text . '
'; + } + + + public function error($text = null) + { + if (null === $text) { + $text = $this->text; + } + return '
' . $text . '
'; + } + +}