[eluser]bEz[/eluser]
[quote author="The Mask" date="1257345100"]My problem with the login validation (passwords not matching) is fixed now.
For others who may hit this problem, I was using $u->from_array( $_POST ) which was not setting the confirm_password property because it isn't a database column.
I changed it to $u->from_array( $_POST, array( 'mem_password', 'confirm_password') ) and now it works as expected.[/quote]
The example "BUGS" application which is packaged with the latest DMz version has sample code for processing form data using the extension method => "from_array()"
I now include a function in the declaration of my models which returns a related fields array. I used a function call in the case that I may need to provide alternative array sets and/or do complicated assignments.
Code:
/*
* rel_fields() :: currently no paramter (switch option) required.
*
* - partial/modified from Phil's example 'bugs' application
*/
$z = new Zone();
$z->trans_start();
// --------------------------------------------------------------
$rel = $z->from_array( $_POST, $z->rel_fields() );
// --------------------------------------------------------------
$exists = $z->exists();
if ( $z->save($rel) )
{ // saved successfully, so commit ...
$z>trans_complete();
// Store a message
if ( $exists ) {
... UPDATE SUCCESSFUL ...
} else {
... INSERT SUCCESSFUL ...
}
}