views:

28

answers:

1

Hi,

i've got a table with articles. The table has the fields id, title and text.

I'm using the sluggable behaviour on the title-field resulting in a unique url

$sluggable0 = new Doctrine_Template_Sluggable(
        array('name'=>'url',
                'fields'=>array(0 => 'title'),
                'unique'=>true,
                'canUpdate'=>true)
);
$this->actAs($sluggable0);

Now I'd like to use the article in multiple languagles. The text is now internationalized using the I18n-behaviour

   $this->actAs('I18n', array('fields'=>array('text')));

My question: how can I internationalize the title field, so that there are unique url's in each language that will be used?

Thanks!!

+2  A: 

It's really simple, you'll need to add the sluggable item as a child to I18n behavior.

So try this:

$i18n = new Doctrine_Template_I18n(array('fields' => array('text')));
$i18n->addChild($sluggable0);
$this->actAs($i18n);
great answer! thanks!
murze