listAvailable() public static method

Lists available locales, used on the back-end.
public static listAvailable ( ) : array
return array
コード例 #1
0
 /**
  * Removes localized content files from templates collection
  * @param \October\Rain\Database\Collection $templates
  * @return \October\Rain\Database\Collection
  */
 public function pruneTranslatedContentTemplates($templates)
 {
     $locales = LocaleModel::listAvailable();
     $extensions = array_map(function ($ext) {
         return '.' . $ext;
     }, array_keys($locales));
     return $templates->filter(function ($template) use($extensions) {
         return !Str::endsWith($template->getBaseFileName(), $extensions);
     });
 }
コード例 #2
0
ファイル: MLControl.php プロジェクト: aydancoskun/octobercms
 /**
  * Prepares the list data
  */
 public function prepareLocaleVars()
 {
     $this->vars['defaultLocale'] = $this->defaultLocale;
     $this->vars['locales'] = Locale::listAvailable();
     $this->vars['field'] = $this->makeRenderFormField();
 }