Hi,
I am doing some form validation using the validation libs.
I have a bunch of the usual CRUD views.
To keep things DRY I share the same form for Adding and Updating.
When using the validation lib I have to populate the form values using:
... value="<?php echo( $this->validation->title) ?>"/>
and so on…
When Updating an object these values are populated from some other data source so the above method does not work. I.e. The initial values come from a model object passed to the view and not the validation object.
How would one do this so I can share the same form and have validation… I could examine the validation object prior to populating each field, like:
... value="<?php echo( $this->validation->title?$this->validation->title:$title) ?>"/>
but I can’t help think there must be a better way.
Any suggestions would be good.
Thanks
Paul
