[yii]Trying to get property of non-object
今天接触gridview的时候,发现总是报错,如图。

array(
'name'=>'user_info.userinfo', 'value'=>'$data->user_info->userinfo',
),
总觉得代码没问题。因为
'value'=>'$data->city->name', //eval() inner
这个都没有问题,表也核对过了,也没有问题。
但是用户信息总调用不出来,经过猜测,“Trying to get property of non-object” 看着意思猜测可能是内容为空导致的。
于是添加了一个判断:
'value'=>'!empty($data->user_info->userinfo)?$data->user_info->userinfo:""',
刷新就好了。

【感悟:多思考】
[yii]Trying to get property of non-object的更多相关文章
- 2.mongoDB add user in v3.0 问题的解决(Property 'addUser' of object admin is not a func)
问题:创建mongodb帐户时,出错 > db.addUser('jyu', 'aerohive') 2015-08-05T20:03:02.767+0800 E QUERY TypeE ...
- Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
Vue的报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' ...
- Vue报错:Uncaught TypeError: Cannot assign to read only property’exports‘ of object’#<Object>‘的解决方法
发现问题 运行一下以前的一个Vue+webpack的 vue仿新闻网站 小项目,报错 由于自己vue学习不深入,老是这个报错,找了好久(确切的说是整整一下午^...^)才找到原因 -v- Uncau ...
- [one day one question] webpack 打包报错 Cannot assign to read only property 'exports' of object '#<Object>'
问题描述: webpack 打包报错 Cannot assign to read only property 'exports' of object '#<Object>',这怎么破? 解 ...
- Property 'submit' of object #<HTMLFormElement> is not a function
<form action="" type="get" id="form"> <input type="butto ...
- Vue 使用自定义组件时报错:Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
自己试做了一下vue的插件 参考element-ui: 写了一个组件 import message from './packages/message/index.js'; const install ...
- Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>' 点开错误的文 ...
- vue运行报错error:Cannot assign to read only property 'exports' of object '#<Object>'
用weex做项目的时候,npm start 之后一直报错error:Cannot assign to read only property 'exports' of object '#<Obje ...
- 在Vue中使用i18n 国际化遇到 Uncaught TypeError: Cannot assign to read only property 'exports' of object '#<Object>'
最近用Vue在搭建前端框架,在引用i18n时,运行的时候报错:Uncaught TypeError: Cannot assign to read only property 'exports' of ...
- Cannot assign to read only property 'exports' of object '#<Object>' ,文件名大小写问题!!!
有些坑不知道怎么就掉进去,可能一辈子都爬不起来!!! 一.错误描述 昨天还好好的,今天早上来从git获取了一下别人提交的代码就出错了!而提交代码的人 运行一点错误都没有!!! cya@KQ-101 M ...
随机推荐
- fzu 2039 Pets (简单二分图 + (最大流 || 二分图))
Are you interested in pets? There is a very famous pets shop in the center of the ACM city. There ar ...
- sql中decode()重要函数使用
decode()函数简介: 主要作用:将查询结果翻译成其他值(即以其他形式表现出来,以下举例说明): 使用方法: Select decode(columnname,值1,翻译值1,值2,翻译值2,.. ...
- await 暂停 等待 暂停的是什么
体验异步的终极解决方案-ES7的Async/Await var sleep = function (time) { return new Promise(function (resolve, reje ...
- Pentaho BIServer Community Edtion 6.1 使用教程 第一篇 软件安装
一.简介: Pentaho BI Server 分为企业版和社区版两个版本.其中 社区版 CE(community edtion) 为免费版本. 二.下载CE版(CentOS): 后台下载命令: no ...
- StreamWriter结合UTF-8编码使用不当,会造成BOM(Byte Order Mark )问题生成乱码(转载)
问: I was using HttpWebRequest to try a rest api in ASP.NET Core MVC.Here is my HttpWebRequest client ...
- HTML5颜色渐变3D文字特效
在线演示 本地下载
- webpack-dev-server原理及要点笔记
webpack-dev-server启动了一个使用express的Http服务器,这个服务器与客户端采用websocket通信协议,当原始文件发生改变,webpack-dev-server会实时编译. ...
- callback机制之内核通知链表【转】
本文转载自:http://bbs.chinaunix.net/thread-2011776-1-1.html 1.通知链表简介 大多数内核子系统都是相互独立的,因此某个子系统可能对其它子系统产生 ...
- 51nod 1022 石子归并 V2 —— DP四边形不等式优化
题目链接:http://www.51nod.com/onlineJudge/questionCode.html#!problemId=1022 1022 石子归并 V2 基准时间限制:1 秒 空间限 ...
- LightOJ - 1321 Sending Packets —— 概率期望
题目链接:https://vjudge.net/problem/LightOJ-1321 1321 - Sending Packets PDF (English) Statistics Foru ...