public function languages($key = null, $subkey = null)
    {
        if ($key === null) {
            return $this->languagesIso;
        }

        if (is_int($key)) {
            if (is_null($subkey)) {
                return $this->languagesId[$key];
            }

            return $this->languagesId[$key][$subkey];
        }

        if (is_null($subkey)) {
            return $this->languagesIso[$key];
        }

        return $this->languagesIso[$key][$subkey];
    }
public function languages($key = null, $subkey = null)
    {
        if ($key === null) {
            return $this->languagesIso;
        }

        if (is_int($key)) {
            if (is_null($subkey)) {
                return $this->languagesId[$key];
            }

            return $this->languagesId[$key][$subkey];
        }

        if (is_null($subkey)) {
            return $this->languagesIso[$key];
        }

        return $this->languagesIso[$key][$subkey];
    }
public function languages ( $ key = null , $ subkey = null ) { if ( $ key === null ) { return $ this -> languagesIso ; } if ( is_int ( $ key ) ) { if ( is_null ( $ subkey ) ) { return $ this -> languagesId [ $ key ] ; } return $ this -> languagesId [ $ key ] [ $ subkey ] ; } if ( is_null ( $ subkey ) ) { return $ this -> languagesIso [ $ key ] ; } return $ this -> languagesIso [ $ key ] [ $ subkey ] ; }
Retrieve languages.

this is a hybrid method.


I18N::languages();
returns ['fr' => ['id' => 1, 'name' => 'francais', 'iso' => 'fr'], 'en' => ...]


I18N::languages('fr');
returns ['id' => 1, 'name' => 'francais', 'iso' => 'fr']


I18N::languages(1);
returns ['id' => 1, 'name' => 'francais', 'iso' => 'fr']


I18N::languages('fr', 'id');
returns 1

@param int|string $key
@param string $subkey
@return array
Retrieve languages .