-
Notifications
You must be signed in to change notification settings - Fork 33
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tags with different categories #11
Comments
It can be done without any additions to current behavior code and attaching multiple behaviors. I'll show how inside |
This drawback will be fixed. Thanks for catching. |
There is |
Looking forward to that! Will it also address the second issue (automatically saving |
Yes, this attribute is very useful. I don't think it worth implementing such method if for some reason user does not want to keep this field in the database. What I meant is that in Yii1 getting this data was as simple as: With this extension it seems like we would need to do something like |
Such taggable behaviors are a convenient way to store information for attributes that can take an array of values. And sometimes it is convenient to store information about different attributes in the same table using a special column to distinguish, say,
category
. What would be very useful if this extension allowed to work (save, load, search etc) with multiple tag categories defined for the same model.This functionality was available in Yii1 through taggable extension by @samdark and was very useful.
You could potentially build on top of existing approach by attaching multiple
TaggableBehavior
behaviors, one per tag category, and adding a specificwhere
clause like->where('category = :category', [':category' => $category]);
to each relation. But it has certain problems:TaggableQueryBehavior
right now does not distinguish between owner's behaviors and uses$model->tagRelation
which would reference a relation from the first bahavior it finds instead of the one we need.insertValues
property in Yii1 taggable extension.getAllTagsWithModelsCount
, but this is less critical.The text was updated successfully, but these errors were encountered: