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.
protected/extensionsSee 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'; } }
Total 2 comments
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!
Thanks! It saved me a lot of time.
Leave a comment
Please login to leave your comment.