twSblamPlugin - 0.0.2

Antispam validator plugin

You are currently browsing
the website for symfony 1

Visit the Symfony2 website

« Back to the Plugins Home


Forgot your password?
Create an account



advanced search
Information Readme Releases Changelog Contribute
Show source

twSblam plugin

The twSblamPlugin is antispam validator plugin. It uses Sblam antispam system to validate message. Is much better front line check system than Captcha. Captcha can be used as second test if SBLAM say propablu SPAM or SPAM to not angry users using to much links in their posts dor example.

Sblam project site is now only in Polish version but if someone help translate this site I think that lead developer of this project will be happy.


  • Install the plugin

    $ symfony plugin:install twSblamPlugin


You can use Sblam Validator class like normal validator



    class SblamTestForm extends sfForm {
        public function configure() {
                'name'    => new sfWidgetFormInputText(),
                'email'   => new sfWidgetFormInputText(),
                'message' => new sfWidgetFormTextarea(),
                'www'     => new sfWidgetFormInputText(),


                'name'    => new sfValidatorString(array('required' => false)),
                'email'   => new sfValidatorEmail(array('required' => false, 'trim' => true)),
                'message' => new sfValidatorString(array('min_length' => 4, 'trim' => true)),
                'www'     => new sfValidatorUrl(array('required' => false, 'trim' => true)),

            $this->validatorSchema->setPostValidator(new sfValidatorSblam(array('blogpost' => array('message', 'name', 'email', 'www')), 'zwxkS5pDST8v8qdd8e', sfValidatorSblam::PROBABLY_SPAM));


In upper example Validator will react where SBLAm returns sfValidatorSblam::PROBABLY_SPAM or sfValidatorSblam::SPAM (result >= 1)

You can chose list of types when Validator react's:

    $this->validatorSchema->setPostValidator(new sfValidatorSblam(array('blogpost' => array('message', 'name', 'email', 'www')), 'zwxkS5pDST8v8qdd8e', array(sfValidatorSblam::SPAM, sfValidatorSblam::SERVER_ERROR)));


    class testformActions extends sfActions {
        public function executeIndex(sfWebRequest $request) {
            $this->form = new SblamTestForm();
            if ($request->isMethod('post')) {
                if ($this->form->isValid()) {

        public function executeOk(sfWebRequest $request) {


2010-03-07 | 0.0.1 Alpha

  • ldath: Initial version

2010-03-16 | 0.0.2 Alpha

  • ldath: rewriting SBLAM client php file for better use with symfony
  • ldath: first validator version