Tuesday, February 5, 2013

Using translate behavior and receive associated data via paginate???

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.
 
 

No comments: