protected static $_has_many = array('i18n_category');
protected static $_properties = array(
'id',
'uri',
);
model/i18n/category.php
protected static $_belongs_to = array('category', 'lang');
protected static $_properties = array(
'id',
'category_id',
'lang_id',
'title',
);
model/lang.php
protected static $_properties = array( 'id', 'slug', 'title', 'default', );so if I want to echo all category titles in "active" language I write this
$categories = Model_Category::find('all');
foreach($categories as $category)
foreach($category->i18n_category as $i)
echo $i->lang->slug == LANG ? $i->title : '';
It looks like you're new here. If you want to get involved, click one of these buttons!