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 withtimeAgoInWords()
, 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');
精彩评论