I have successfully managed to install sfDoctrineActAsTaggablePlugin, added the Taggable behavior to the model I want to be taggable in schema.yml and rebuilt all models. Can someone point me to a tutorial that shows how to attach the tags to an object and retrieve the objects tags? I am not sure where to go from here. I am looking for a very simple solution. Something that allows me add tags separated by commas and retrieve them. Thanks.
1 に答える
0
README ファイルで定義されているように、次のように簡単です。
Doctrine の "Post" クラスを考えてみましょう:
$post = new Post();
$post->addTag('toto');
$post->addTag('tata, tutu');
$post->addTag(array('Titi', 'Gros Minet'));
$post->save();
プラグインはマシンタグをサポートしています:
$post = new Post();
$post->addTag('iso:isbn=123456789');
$post->save();
// assume City is a taggable class
$city = new City();
$city->addTag('geo:lat=47.3456');
$city->save();
于 2012-05-19T06:38:04.813 に答える