Is it possible to set Zend_Date options in application.ini config?

217 Views Asked by At

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.* ?

1

There are 1 best solutions below

0
b.b3rn4rd On BEST ANSWER

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']);
    }    
}