标签:翻译 log idt php 配置文件 技术分享 map link info
‘language‘ => ‘zh-CN‘,
//配置语言包 ‘i18n‘ =>[ ‘translations‘ => [ ‘*‘ => [ ‘class‘ => ‘yii\i18n\PhpMessageSource‘, //‘basePath‘ => ‘/messages‘, ‘fileMap‘ => [ ‘common‘ => ‘common.php‘ ], ] ], ],
<?php return [ ‘Blog‘ => ‘博客‘, ‘Home‘ => ‘首页‘, ‘About‘ => ‘关于我们‘, ‘Contact‘ => ‘联系我们‘, ‘Signup‘ => ‘注册‘, ‘Login‘ => ‘登录‘, ];
<?php NavBar::begin([ ‘brandLabel‘ => Yii::t(‘common‘, ‘Blog‘), ‘brandUrl‘ => Yii::$app->homeUrl, ‘options‘ => [ ‘class‘ => ‘navbar-inverse navbar-fixed-top‘, ], ]); $menuItems = [ [‘label‘ => Yii::t(‘yii‘, ‘Home‘), ‘url‘ => [‘/site/index‘]], [‘label‘ => Yii::t(‘common‘, ‘About‘), ‘url‘ => [‘/site/about‘]], [‘label‘ => Yii::t(‘common‘, ‘Contact‘), ‘url‘ => [‘/site/contact‘]], ]; if (Yii::$app->user->isGuest) { $menuItems[] = [‘label‘ => Yii::t(‘common‘, ‘Signup‘), ‘url‘ => [‘/site/signup‘]]; $menuItems[] = [‘label‘ => Yii::t(‘common‘, ‘Login‘), ‘url‘ => [‘/site/login‘]]; } else { $menuItems[] = [ ‘label‘ => ‘Logout (‘ . Yii::$app->user->identity->username . ‘)‘, ‘url‘ => [‘/site/logout‘], ‘linkOptions‘ => [‘data-method‘ => ‘post‘] ]; } echo Nav::widget([ ‘options‘ => [‘class‘ => ‘navbar-nav navbar-right‘], ‘items‘ => $menuItems, ]); NavBar::end(); ?>
标签:翻译 log idt php 配置文件 技术分享 map link info
原文地址:https://www.cnblogs.com/wxdblog/p/8997780.html