This extension is give up, please visit new extension: i18n-activerecord ¶
url: http://www.yiiframework.com/extension/i18n-activerecord/
This extension simplifies the handling of multilingual content stored in the database.
It assumes that you use two tables for your content (one for the main content and a second one for the translations) with a one-to-many relationship between them.
Resources ¶
Documentation ¶
Requirements ¶
- Yii 1.1 or above
Installation ¶
- Extract the release file under
protected/extensions
Usage ¶
See the following code example:
class Product extends JMultilingualActiveRecord
{
public function localizedAttributes()
{
return array('name','content');
}
public function languages()
{
return array('zh_cn');
}
public function primaryLang()
{
return array('en_us');
}
public function langClassName()
{
return __CLASS__.'Mui';
}
public function langForeignKey()
{
return 'owner_id';
}
}
Change Log ¶
Alpha 2 ¶
- add filter by special attribute useage: News::model()->localized('zh_cn', 'title')->findAll(); it will only match title is not empty rows
Perfect!
After wasting few days trying to write behavior to do all that, I tried your ML AR and it does exactly what I want. Thank you!
Great work!
Thanks! It saved me a lot of time.
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.