2017 © Pedro Peláez
 

yii2-extension yii2-taxonomy-term

taxonomy term implementation in Yii2

image

mhndev/yii2-taxonomy-term

taxonomy term implementation in Yii2

  • Wednesday, August 31, 2016
  • by majidphpdeveloper
  • Repository
  • 2 Watchers
  • 3 Stars
  • 171 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 2 Open issues
  • 8 Versions
  • 88 % Grown

The README.md

Taxonomy Term

taxonomy term implementation in Yii2, (*1)

Installation

The preferred way to install this extension is through composer., (*2)

Either run, (*3)

composer require --prefer-dist mhndev/yii2-taxonomy-term "1.*"

or add, (*4)

"mhndev/yii2-taxonomy-term": "1.*"

to the require section of your composer.json file., (*5)

Execute Migrations

php yii migrate --migrationPath=@vendor/mhndev/yii2-taxonomy-term/src/migrations

Usage

user mhndev\yii2TaxonomyTerm\traits\TermableTrait in each Model which you want to use taxonomy-term for, (*6)

example

Post Model
class Post extends ActiveRecord
{

    use TermableTrait;

    /**
     * @return string
     */
    public static function tableName()
    {
        return 'posts';

    }

    /**
     * @return array
     */
    public function rules()
    {
        return [
            [['title'], 'required'],
            [['text'], 'required'],
        ];
    }

}

attach a term to an entity

    $term = Term::findOne(['id'=>1]);
    $post = Post::findOne(['id'=>1]);
    $post->attachTerm($term);

detach a term from an entity

    $term = Term::findOne(['id'=>1]);
    $post = Post::findOne(['id'=>1]);
    $post->detachTerm($term);

list terms of an entity

    $post = Post::findOne(['id'=>1]);
    $post->listTerms();

get term tree

    $term = Term::findOne(['id'=>1]);
    $term->getTree();

The Versions

31/08 2016

dev-master

9999999-dev

taxonomy term implementation in Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 tag taxonomy category term

31/08 2016

dev-develop

dev-develop

taxonomy term implementation in Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 tag taxonomy category term

31/08 2016

1.0.5

1.0.5.0

taxonomy term implementation in Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 tag taxonomy category term

31/08 2016

1.0.4

1.0.4.0

taxonomy term implementation in Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 tag taxonomy category term

31/08 2016

1.0.3

1.0.3.0

taxonomy term implementation in Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 tag taxonomy category term

30/08 2016

1.0.2

1.0.2.0

taxonomy term implementation in Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 tag taxonomy category term

30/08 2016

1.0.1

1.0.1.0

taxonomy term implementation in Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 tag taxonomy category term

30/08 2016

1.0.0

1.0.0.0

taxonomy term implementation in Yii2

  Sources   Download

MIT

The Requires

 

extension yii2 tag taxonomy category term