Re: how to display a different field name from the database in the model

2008-10-05 Thread the_woodsman
I'm pretty sure someone wrote a behavior to handle this, perhaps the Alias behaviour? Look in the bakery... On Oct 5, 7:42 am, "David C. Zentgraf" <[EMAIL PROTECTED]> wrote: > You should really look into changing the variable name in the code.   > With search&replace this may be the best option.

Re: how to display a different field name from the database in the model

2008-10-04 Thread David C. Zentgraf
You should really look into changing the variable name in the code. With search&replace this may be the best option. Otherwise, you could do that in the model with the afterFind callback. Just copy the field: $model['name'] = $model['name_en_gb']; But you're setting yourself up for all kinds o

Re: how to display a different field name from the database in the model

2008-10-04 Thread robert123
hi, Thank you, I have a cakephp application, the product model has the 'name' field, and all the codes, that is the controller, view, call that field as 'name'. but right now the product table in the database which has the field 'name' has been changed to 'name_en_gb', I am wondering, is there a

Re: how to display a different field name from the database in the model

2008-10-04 Thread David C. Zentgraf
If you mean "display to the user" I don't see where the problem is. If you're talking about scaffolding, just make a proper view. If you mean "change internally" it's more hassle than it's worth IMHO. Can you clarify a bit what you want to do and where you're stuck? On 5 Oct 2008, at 10:32, robe

Re: how to display a different field name from the database in the model

2008-10-04 Thread Christian Leskowsky
This should be taken care of by your view. You'd do something like this in your form: input('name_en_gb', array('label' => __('name', true))); ?> Good Luck! Christian - Original Message - From: "robert123" <[EMAIL PROTECTED]> To: "CakePHP" Sent: Saturday, October 04, 2008 9:32 PM Su