🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
~~~ <php> $after_content_hook_param=[ 'object_id'=>$article['id'], 'table_name'=>'portal_post', 'object_title'=>$article['post_title'], 'user_id'=>$article['user_id'], 'url'=>cmf_url_encode('portal/Article/index',array('id'=>$article['id'],'cid'=>$category['id'])), 'object'=>$article ]; </php> <hook name="after_content" param="after_content_hook_param"/> <php> $comment_hook_param=[ 'object_id'=>$article['id'], 'table_name'=>'portal_post', 'object_title'=>$article['post_title'], 'url'=>cmf_url_encode('portal/Article/index',array('id'=>$article['id'],'cid'=>$category['id'])) ]; $comment=hook_one('comment',$comment_hook_param); </php> <if condition="empty($comment) && cmf_get_current_admin_id()"> <div style="border: 1px dashed #ddd;min-height: 200px;padding-top: 50px;"> <div class="alert alert-warning" role="alert"> 此区域这为评论区,请安装评论插件!<br> <em>注:普通用户不会看到此提示!</em> </div> </div> </if> {$comment} ~~~ 这是cmf原本写好的 comment带入的参数为 ~~~ $comment_hook_param=[ 'object_id'=>$article['id'], 'table_name'=>'portal_post', 'object_title'=>$article['post_title'], 'url'=>cmf_url_encode('portal/Article/index',array('id'=>$article['id'],'cid'=>$category['id'])) ]; $comment=hook_one('comment',$comment_hook_param); ~~~ 相当于调用插件中的comment方法