UI lacks information about how to use this feature.
And having a look at module code, it seems that it is not possible to access the value to validate!

<?php
  public function validate() {
    return eval($this->rule->settings['data']);
  }
?>

Am I missing something?
Please help, thanks.

Comments

g089h515r806’s picture

here is the document.
http://drupal.org/node/1537028

anrikun’s picture

Title: How is validation rule "PHP code" supposed to work? » Add some description to validation rule "PHP code"
Category: support » feature
Priority: Normal » Minor

Nice documentation, thank you very much!
I just suggest you add some description to the form itself about this.
Turning this into a minor feature request.

anrikun’s picture

Title: Add some description to validation rule "PHP code" » Add some description to validation rule "PHP code" about not to use <?php ?> tags
Priority: Minor » Major

After all, I prefer to change this into a major feature request about one important thing:
Please add that <?php ?> tags must not be used.
I have spent some time figuring out this :-)

g089h515r806’s picture

Status: Active » Fixed

already fixed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.