师阳
- 师阳 2018-10-07 已签到连续签到1天,获得了5个金钱
- 师阳 2018-06-12 已签到连续签到1天,获得了5个金钱
- 师阳 2018-06-06 已签到连续签到3天,获得了15个金钱
- 师阳 2018-06-05 已签到连续签到2天,获得了10个金钱
- 师阳 2018-06-04 已签到连续签到1天,获得了5个金钱
- 师阳 2018-05-28 已签到连续签到1天,获得了5个金钱
- 师阳 2018-04-22 已签到连续签到1天,获得了5个金钱
- 师阳 回答了问题 公共文件header和footer 数据信息显示
如果是用户的个人信息,可以用
Yii::$app->user->identity->username;
其它的话,可以通过
params
这个属性://View 文件源码 class View extends Component implements DynamicContentAwareInterface { ... /** * @var mixed custom parameters that are shared among view templates. */ public $params = []; ... }
用法举例
首先需要在视图文件中:
$this->params['model'] = $model; $this->params['example'] = $example; ...
然后在
main.php
布局文件中就可以:$model = $this->params['model']; $example = $this->params['example']; ... print_r($model); //在你需要显示的地方显示 print_r($example); //在你需要显示的地方显示
- 师阳 2018-04-13 已签到连续签到1天,获得了5个金钱
- 师阳 2018-04-11 已签到连续签到2天,获得了10个金钱