benji07/

akismet-bundle

此包最新版本(dev-master)没有可用的许可信息。

Symfony Benji07 AkismetBundle

安装数: 45,487

依赖: 0

建议者: 0

安全: 0

星标: 5

关注者: 3

分支: 2

开放问题: 0

类型:symfony-bundle

dev-master 2012-03-11 10:17 UTC

This package is not auto-updated.

Last update: 2024-09-22 03:08:52 UTC


README

#Benji07AkismetBundle

用于在Symfony2中使用akismet api的Bundle

配置

[yml]
benji_akismet
  key: your key
  blog: your site homepage

使用方法

[php]
$data = array(
    'user_ip' => $comment->getUserIp(),
    'user_agent' => $comment->getUserAgent(),
    'referrer' => $comment->getReferrer(),
    'comment_type' => 'comment',
    'comment_author' => $comment->getUsername(),
    'comment_author_email' => $comment->getEmail(),
    'comment_content' => $comment->getContent()
);

// check if $comment is a spam
$this['akismet']->isSpam($data);

// submit a spam
$this['akismet']->submitSpam($data);

// submit a ham
$this['akismet']->submitHam($data);