Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
May I include fake property for validation purposes?
  • I want to create validation rule for check password match with confirm_password field. Where I can set this field and validation rules if I decided to use Orm\Model $_properties for all others real fields?
  • Ok, I understand. I add rule 'match_field' for 'password' field... and that is all... well
  • Rule is silent... Seems, I must to create my own rule...

    It have to be a bueatiful solution of this...
  • HarroHarro
    Accepted Answer
    You can not add fake properties to an ORM model, it will confuse the ORM.

    But you can add additional fields to the validation instance without problems. When the fieldset for the ORM model is created, it calls the method "set_form_fields" in the ORM model.

    You can overload this method in your model. It gets passed the fieldset object, so you can add additional fields there, either before or after the parent::set_form_fields() call.
  • Thank you. You are right, as usual :)

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion