Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- class Zend_View_Helper_formataData extends Zend_View_Helper_Abstract
- {
- /**
- * Manipulador de Datas
- * @var Zend_Date
- */
- protected static $_date = null;
- /**
- * Método Principal
- * @param string $value Valor para Formatação
- * @param string $format Formato de SaÃda
- * @return string Valor Formatado
- */
- public function formataData($value, $format = Zend_Date::DATETIME_MEDIUM)
- {
- $date = $this->getDate();
- return $date->set($value)->get($format);
- }
- /**
- * Acesso ao Manipulador de Datas
- * @return Zend_Date
- */
- public function getDate()
- {
- if (self::$_date == null) {
- self::$_date = new Zend_Date();
- }
- return self::$_date;
- }
- }
Add Comment
Please, Sign In to add comment