From 1cdd38eb5dc9d610d21734fefb273196e6f53d30 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=A9bastien=20CHAZALLET?= Date: Sun, 18 Nov 2012 19:36:10 +0100 Subject: [PATCH] Rajout d'une aide de vue --- vendor/zf2biz/Custom/View/Helper/Format.php | 70 +++++++++++++++++++++++++++ 1 file changed, 70 insertions(+) create mode 100644 vendor/zf2biz/Custom/View/Helper/Format.php 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 . '
'; + } + +} -- 1.7.10.4