1

Is it possible to set Zend_Date options in application.ini config like this:

resources.date.options.format_type = php

in Zend Framework v 1.* ?

b.b3rn4rd
  • 8,494
  • 2
  • 45
  • 57
avasin
  • 9,186
  • 18
  • 80
  • 127

1 Answers1

2

By default such resource it not available: http://framework.zend.com/manual/1.12/en/zend.application.available-resources.html

However, nothing stops you from creating your own resource:

1.In application.ini specify resource path & date settings

pluginPaths.My_Application_Resource = "My/Application/Resource"
resources.date.options.format_type = "php"

2.Creating resource

<?php
class My_Application_Resource_Date extends Zend_Application_Resource_ResourceAbstract
{
    public function init()
    {
        $options = $this->getOptions();
        Zend_Date::setOptions($options['options']);
    }    
}
b.b3rn4rd
  • 8,494
  • 2
  • 45
  • 57