Thought this might help someone.  If you refactor, please post.  I
haven't tested in all conditions, though I know it works at least in
1-level recursion.

The idea is to be able to dynamically add fields to any of your models
(with the smallest footprint)...

ie. $full_name = $first_name . ' ' . $last_name;

Here's the app_model.php base class.
http://viewvc.churchalive.biz/viewvc/dev.godinvite.com/httpdocs/app/app_model.php?view=co

And here's an example model:
http://viewvc.churchalive.biz/viewvc/dev.godinvite.com/httpdocs/app/models/template.php?view=co

So, using the above "full_name" example in a model class called
"Person", you'd add the method...

function addFieldFullName($x) {
    return $x['full_name'] = $x['first_name'] . ' ' . $x['last_name'];
}


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to