sterzycom/kirby/branches/multilang/languages.php

28 lines
No EOL
474 B
PHP

<?php
/**
* Languages
*
* Holds all available Language objects for the site
*/
class Languages extends Collection {
protected $site = null;
public function __construct($site) {
return $this->site = $site;
}
public function find($code) {
return isset($this->data[$code]) ? $this->data[$code] : null;
}
public function codes() {
return $this->keys();
}
public function findDefault() {
return $this->site->defaultLanguage();
}
}