Tools\Utility\Time::monthNames PHP Method

monthNames() public static method

Months
public static monthNames ( array $monthKeys = [], array $options = [] ) : array
$monthKeys array
$options array
return array
    public static function monthNames(array $monthKeys = [], array $options = [])
    {
        if (!$monthKeys) {
            $monthKeys = range(1, 12);
        }
        $res = [];
        $abbr = isset($options['abbr']) ? $options['abbr'] : false;
        foreach ($monthKeys as $key) {
            $res[static::pad($key)] = static::monthName($key, $abbr, $options);
        }
        return $res;
    }

Usage Example

コード例 #1
0
ファイル: TimeTest.php プロジェクト: alescx/cakephp-tools
 /**
  * TimeTest::testMonths()
  *
  * @return void
  */
 public function testMonthNames()
 {
     //$this->out($this->_header(__FUNCTION__), true);
     $ret = $this->Time->monthNames();
     $this->assertTrue(count($ret) === 12);
 }