thinkphp5中的_initialize方法
2022-07-28 14:14:58
165
{{single.collect_count}}

<?php 

public function _initialize(){
echo  '优先执行的操作'.'<br />';
}


初始化方法的注意事项 :
a)使用初始化方法必须继承Controller控制器类
b)输出必须使用echo,return输出是不会显示的


?>

回帖
全部回帖({{commentCount}})
{{item.user.nickname}} {{item.user.group_title}} {{item.friend_time}}
{{item.content}}
{{item.comment_content_show ? '取消' : '回复'}} 删除
回帖
{{reply.user.nickname}} {{reply.user.group_title}} {{reply.friend_time}}
{{reply.content}}
{{reply.comment_content_show ? '取消' : '回复'}} 删除
回帖
收起
没有更多啦~
{{commentLoading ? '加载中...' : '查看更多评论'}}