This problem has come up often. If you search "cakephp translate
belongsto" you'll see some interesting fixes. I don't know if recent
versions make these unnecessary, though, so there may be a new
"standard" way to address this. Certainly, you should always consider
the date that something was posted, as Cake has changed a lot in the
past several years.
On Tue, Feb 5, 2013 at 10:34 AM, Salines <nikola.paradzik@gmail.com> wrote:
> Hi,
> I ask for advice,
> how to return a translated result from a related model, where we have the
> following relationship:
>
> PricePeriod belongsTo Apartment
>
> Now in PricePeriodController :: index should return results in the default
> language. Everything works except that I can not get the localized name.
>
> code:
>
> public function admin_index() {
> $this->PricePeriod->locale = 'hrv';
> $this->PricePeriod->recursive = 0;
> $this->paginate = array('order' => array('PricePeriod.apartment_id'=>
> 'asc'));
> $this->set('pricePeriods', $this->paginate());
> }
>
> Thanks
>
> --
> Like Us on FaceBook https://www.facebook.com/CakePHP
> Find us on Twitter http://twitter.com/CakePHP
>
> ---
> You received this message because you are subscribed to the Google Groups
> "CakePHP" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to cake-php+unsubscribe@googlegroups.com.
> To post to this group, send email to cake-php@googlegroups.com.
> Visit this group at http://groups.google.com/group/cake-php?hl=en.
> For more options, visit https://groups.google.com/groups/opt_out.
>
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment