开发者

Can't access time helper from view

<?php echo $time->timeAgoInWords($row['Forum']['modified']); ?>

The modified column from which I am receiving the data is formatted as MySQL datetime.

I am trying to use the above code to get a time value shown formatted with timeAgoInWords(), but I keep getting this error.

Undefined property: time [APP\views\forums\view.ctp, line 6开发者_C百科0]

I don't understand why I am getting this error.


In Your controller or app_controller, Put below code,

var $helpers = array('Form', 'Html', 'Javascript', 'Time');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜