Php 如何将I8n行为与条令中的slagable行为结合使用

Php 如何将I8n行为与条令中的slagable行为结合使用,php,internationalization,doctrine,slug,Php,Internationalization,Doctrine,Slug,我有一张摆放物品的桌子。该表包含字段id、标题和文本 我在title字段上使用了slagable行为,从而生成了一个唯一的url $sluggable0 = new Doctrine_Template_Sluggable( array('name'=>'url', 'fields'=>array(0 => 'title'), 'unique'=>true, 'c

我有一张摆放物品的桌子。该表包含字段id、标题和文本

我在title字段上使用了slagable行为,从而生成了一个唯一的url

$sluggable0 = new Doctrine_Template_Sluggable(
        array('name'=>'url',
                'fields'=>array(0 => 'title'),
                'unique'=>true,
                'canUpdate'=>true)
);
$this->actAs($sluggable0);
现在我想用多种语言来描述这篇文章。现在使用I18n行为将文本国际化

   $this->actAs('I18n', array('fields'=>array('text')));
我的问题是:如何国际化标题字段,以便在将使用的每种语言中都有唯一的url


谢谢

这非常简单,您需要将可播放项作为子项添加到I18n行为中

所以试试这个:

$i18n = new Doctrine_Template_I18n(array('fields' => array('text')));
$i18n->addChild($sluggable0);
$this->actAs($i18n);