php菜单管理样式模板,php – SilverStripe Fluent菜单模板
SilverStripe Fluent模塊具有現成的模板,可在前端顯示簡單的語言切換菜單.
>
$Title.XML
當它循環“Locales”時它在技術上是什么循環?沒有名為“Locales”的數據庫表.
我的目標是最終找到返回語言縮寫的變量(或編寫函數)(而不是國家!).所以我需要返回的東西,例如nl而不是nl-NL(因為$LocaleRFC1766返回).
解決方法:
FluentExtension擴展中的Locales is a function:
/**
* Templatable list of all locales
*
* @return ArrayList
*/
public function Locales()
{
$data = array();
foreach (Fluent::locales() as $locale) {
$data[] = $this->owner->LocaleInformation($locale);
}
return new ArrayList($data);
}
$data = array(
'Locale' => $locale,
'LocaleRFC1766' => i18n::convert_rfc1766($locale),
'Alias' => Fluent::alias($locale),
'Title' => i18n::get_locale_name($locale),
'LanguageNative' => Fluent::locale_native_name($locale),
'Language' => i18n::get_lang_from_locale($locale),
'Link' => $link,
'AbsoluteLink' => $link ? Director::absoluteURL($link) : null,
'LinkingMode' => $linkingMode
);
最近添加了語言以允許僅檢索語言縮寫.
要使用它,我們可以創建一個使用$Language變量的自定義LocaleMenu.ss模板:
Locale →rel="alternate" hreflang="$Language">$Title.XML
標簽:php,silverstripe
來源: https://codeday.me/bug/20190608/1200841.html
總結
以上是生活随笔為你收集整理的php菜单管理样式模板,php – SilverStripe Fluent菜单模板的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: eve 服务器在哪个文件夹,eve服务器
- 下一篇: 改变服务器控件的显示属性,2.6.1