Yii2配置
最外层:配置文件,params
Yii2导航
<?php
NavBar::begin([
'brandLabel' => '大海',
'brandUrl' => Yii::$app->homeUrl,
'options' => [
'class' => 'navbar-inverse navbar-fixed-top',
],
]);
$menuItems = [
['label' => '首页', 'url' => ['/site/index']],
['label' => '品牌管理','url' => ['/brand/index']],
['label' => '品牌惠','url' => ['/brand-benefit/index']],
['label' => '角色管理','url' => ['/role/index']],
['label' => '权限管理','url' => ['/permission/index']],
['label' => '分类管理','url' => ['/category/index']],
['label' => '文章管理','url' => ['/news/index']],
['label' => '广告管理','url' => ['/adposition/index']],
['label' => '商铺管理','url' => ['/store/index']],
['label' => '品牌商品','url' => ['/product-base/index']],
['label' => '用户', 'url' => ['/user/index']],
];
if (Yii::$app->user->isGuest) {
$menuItems[] = ['label' => '登录', 'url' => ['/site/login']];
} else {
$menuItems[] = [
'label' => '退出 (' . 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();
?>
Yii2配置的更多相关文章
- windows 下 YII2 配置 memcache
环境: 操作系统 :Windows 7; php: 5.6.8 apche:2.4.12 1.首先安装PHP memcache 拓展,安装方法如下: 1.1下载 memcache 拓展DLL: ht ...
- YII2配置多语言
我的YII2版本是2.0.7, 设置多语言时和其他教程有不同的地方, 所以整理如下 1. 在一个controller里面写一个调用i18n的语句, 比如actionIndex echo \Yii::t ...
- yii2配置表前缀
前缀设置 component中db的配置修改 'db'=>array( 'connectionString' => 'mysql:host=localhost;dbname=xxxx', ...
- windows yii2 配置redis
1 安装redis https://blog.csdn.net/gaotanpan3666/article/details/83047081 安装redis 2 yii安装redis扩展 compo ...
- Yii2 配置request组件解析 json数据
在基础版本的config目录下 web.php 或者高级版config目录下的main.php中配置 'components' =>[ 'request' => [ 'parsers' = ...
- Yii2 配置发送邮件
'components' => [ 'mailer' => [ 'class' => 'yii\swiftmailer\Mailer', 'viewPath' => '@com ...
- Yii2 配置 Nginx 伪静态
主要检查以下代码: location / { # Redirect everything that isn't a real file to index.php try_files $uri $uri ...
- win7 xampp php7 yii2 配置sqlserver
第一步: https://www.microsoft.com/en-us/download/details.aspx?id=20098 下载 如下图 php7 版本 放到 xampp\php ...
- Yii2基本概念之——配置(Configurations)
在Yii中创建新对象或者初始化已经存在的对象广泛的使用配置,配置通常包含被创建对象的类名和一组将要赋值给对象的属性的初始值,这里的属性是Yii2的属性.还可以在对象的事件上绑定事件处理器,或者将行为附 ...
随机推荐
- windows下注册ocx控件
OCX 是对象类别扩充组件(Object Linking and Embedding (OLE) Control Extension):是可执行的文件的一种,但不可直接被执行: 是 ocx 控件的扩展 ...
- docker提示没有开启转发解决方法
vim /usr/lib/sysctl.d/00-system.conf [root@t1 ~]# vim /usr/lib/sysctl.d/00-system.conf# Kernel sysc ...
- HBase封装easy-hbase设计实现
新增码云地址:https://gitee.com/hanmov5/mop-hbase-template 一.写在前面 业务架构用到HBase,但由于某些不可名状原因,没有用phoniex等上层工具,开 ...
- leetcode-168周赛-1297-子串的最大出现次数
题目描述: 自己的提交: class Solution: def maxFreq(self, s: str, maxLetters: int, minSize: int, maxSize: int) ...
- MaxCompute新功能发布
2018年Q3 MaxCompute重磅发布了一系列新功能. 本文对主要新功能和增强功能进行了概述. 实时交互式查询:Lightning on MaxCompute 生态兼容:Spark on Max ...
- python bs4解析网页时 bs4.FeatureNotFound: Couldn't find a tree builder with the features you requested: lxml. Do you need to inst(转)
Python小白,学习时候用到bs4解析网站,报错 bs4.FeatureNotFound: Couldn't find a tree builder with the features you re ...
- iptables对请求的URL作IP访问控制
服务器运行环境是Tomcat,现在要实现的目的是,只允许特定的IP访问某个目录,一种方法是在tomcat配置文件server.conf中,使用RemoteAddrValve对虚拟主机做访问控制.另外一 ...
- SQL生成 C# Model
本文转自: https://www.cnblogs.com/jhli/p/11552105.html declare @TableName sysname = 'T_FakeOrderList' de ...
- linux 查看cpu,memory
https://www.cnblogs.com/ctypyb2002/p/9792951.html
- Tomcat运行错误示例
tomcat运行错误示例 当出现这种错误时,如果是自己配置的tomcat,需要找/conf/server.xml文件. 如果是使用的eclipse tomcat 插件,需要在你的工作空间 找到 如下文 ...