PHPackages                             icomefromthenet/quicktag - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. icomefromthenet/quicktag

ActiveLibrary[Database &amp; ORM](/categories/database)

icomefromthenet/quicktag
========================

Tag Library build on Doctrine DBAL

017PHP

Since Jul 15Pushed 12y ago1 watchersCompare

[ Source](https://github.com/icomefromthenet/QuickTag)[ Packagist](https://packagist.org/packages/icomefromthenet/quicktag)[ RSS](/packages/icomefromthenet-quicktag/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

\#QuickTag - Tags for your application.

[![Build Status](https://camo.githubusercontent.com/a8eeeacf9b9ea3b987f372640944cedd602a75630f9124d35c7eb160e429aaae/68747470733a2f2f7472617669732d63692e6f72672f69636f6d6566726f6d7468656e65742f517569636b5461672e706e673f6272616e63683d6d6173746572)](https://travis-ci.org/icomefromthenet/QuickTag)

1. Written using Doctrine DBAL.
2. Optional Restful Silex API Supports GET/POST/PUT/DELETE.
3. Can be used with Zend/Tag/Cloud, doing tag clouds is easy.
4. PHP 5.3 and up.

\####A Tag has the following properties:

1. Title (45 character) name. no default case upper or lower fine.
2. Weight (float) used to order a set of tags
3. Created (DateTime) used to sort old and new tags
4. UserContext (integer) restrict tags to a given user id.

\##Installing Use Composer

```
    "require" : {
        "icomefromthenet/quicktag" : "dev-master",
    }
```

\##Running

### Just the library.

[](#just-the-library)

```
    $doctrine               = new Doctrine\DBAL\Connection;
    $symfonyEventDispatcher = new Symfony\Component\EventDispatcher\EventDispatcher();
    $monologBridge          = new QuickTag\Log\MonologBridge($monolog);  # bridget implements QuickTag\Log\LogInterface, write own bridge to change logger platform.
    $tableName              = 'quicktag_tags'; # database table name

    $provider               = new QuickTag\TagServiceProvider();
    $tagService             = $provider->instance($doctrine,$event,$logBridge,$tablename);
```

### With Silex

[](#with-silex)

Inside you app.php bootstrap file.

\####Requires the following external dependecies:

1. Monolog,
2. Doctrine DBAL,
3. Symfony2 Event Dispatcher

```
# ----------------------------------------------------
# Include Composer  Autoloader
#
# ---------------------------------------------------

require_once(__DIR__ . "/vendor/autoload.php");

# ----------------------------------------------------
# Create the application
#
# ---------------------------------------------------

$app = new Silex\Application();

#------------------------------------------------------------------
# Add Parse for json requests body
#
#------------------------------------------------------------------

$app->before(function (Symfony\Component\HttpFoundation\Request $request) {
    if (0 === strpos($request->headers->get('Content-Type'), 'application/json')) {
        $data = json_decode($request->getContent(), true);
        $request->request->replace(is_array($data) ? $data : array());
    }
});

# ----------------------------------------------------
# Load ValidatorServiceProvider
#
# ---------------------------------------------------

$app->register(new Silex\Provider\ValidatorServiceProvider());

# ----------------------------------------------------
# Setup Tags
#
# ---------------------------------------------------

$app->register(new QuickTag\Silex\Provider\TagServiceProvider('qtag'), array(
                                'qtag.options' => array(
                                      'tableName' => 'quicktag_tags'
                                )
              ));

#------------------------------------------------------------------
# Setup Routes / Controllers
#
#------------------------------------------------------------------

$app->mount('/', new QuickTag\Silex\Controllers\TagProvider('qtag'));

return $app;
```

If you running different instances you will need to change the index and the table name. In the example above the index is set to **qtag** . You should namespace the index with the name off your app.

\###Setup the sql for the tag table

Don't forget to change the table name!

```
delimiter $$

CREATE TABLE `quicktag_tags` (
  `tag_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
  `tag_user_context` int(10) unsigned DEFAULT NULL,
  `tag_date_created` datetime NOT NULL,
  `tag_weight` double DEFAULT NULL,
  `tag_title` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
  PRIMARY KEY (`tag_id`),
  KEY `IDX_FF11E9291A46B076` (`tag_user_context`)
) ENGINE=InnoDB AUTO_INCREMENT=101 DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci$$
```

The API Methods
---------------

[](#the-api-methods)

### Store a tag Create/Update

[](#store-a-tag-createupdate)

```
    use DateTime;
    use QuickTag\Model\StoredTag;

    $storedTag = new StoredTag();
    $storedTag->setTitle('mytitle');
    $storedTag->setWeight(1);
    $storedTag->setTagCreated(new DateTime());
    $storedTag->setUserContext(3);

    # fetch service from the provider
    $result = $tagService->storeTag($storeTag);

    if($result) {
        echo 'tag has been stored at id '. $storedTag->getTagId();
    }
```

During an update the id must be set and only the title and weight and user context can be changed.

### Lookup a tag by id.

[](#lookup-a-tag-by-id)

```
    use QuickTag\Model\StoredTag;

    # fetch service from the provider
    $storeTag = $tagService->lookupTag($id);

    if($storedTag instanceOf StoredTag ) {
        echo 'tag has been gound at id '. $storedTag->getTagId();
    }
```

### Searching for a tag

[](#searching-for-a-tag)

```
    # Search for tags started with titte `my` and belong to user 3
    $tagCollection = $tagService->findTag()
            ->start()
                ->limit($limit)
                ->offset($offset)
                ->orderByTitle('asc')
                ->filterByNameStartsWith('my')
                ->filterByUserContext(3)
            ->end()
        ->find();

    if(count($tagCollection) > 0 ) {
        echo sprintf('found %s number of tags',count($tagCollection));
    }
```

### Removing a Tag.

[](#removing-a-tag)

```
    use QuickTag\Model\StoredTag;

    $id = 1;

    # fetch service from the provider
    $storeTag = $tagService->lookupTag($id);

    $result = $tagService->removeTag($storeTag);

    if($result) {
        echo 'tag has been removed at id '. $storedTag->getTagId();
    }
```

The API under `QuickTag\Silex\Provider\TagServiceProvider` has basic examples on how to use the library.

### Using Zend Tag Cloud

[](#using-zend-tag-cloud)

```
use Zend\Tag\Cloud;
use QuickTag\Model\StoredTag;

$tagA = new StoredTag();
$tagB = new StoredTag();
$tagC = new StoredTag();

$cloud = new Cloud(array(
    'tags' => array(
       $tagA,$tagB,$tagC
    )
));

// Render the cloud
echo $cloud;
```

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/746782?v=4)[Lewis Dyer](/maintainers/icomefromthenet)[@icomefromthenet](https://github.com/icomefromthenet)

---

Top Contributors

[![icomefromthenet](https://avatars.githubusercontent.com/u/746782?v=4)](https://github.com/icomefromthenet "icomefromthenet (22 commits)")

### Embed Badge

![Health badge](/badges/icomefromthenet-quicktag/health.svg)

```
[![Health](https://phpackages.com/badges/icomefromthenet-quicktag/health.svg)](https://phpackages.com/packages/icomefromthenet-quicktag)
```

###  Alternatives

[doctrine/orm

Object-Relational-Mapper for PHP

10.2k285.3M6.2k](/packages/doctrine-orm)[jdorn/sql-formatter

a PHP SQL highlighting library

3.9k115.1M102](/packages/jdorn-sql-formatter)[illuminate/database

The Illuminate Database package.

2.8k52.4M9.4k](/packages/illuminate-database)[mongodb/mongodb

MongoDB driver library

1.6k64.0M546](/packages/mongodb-mongodb)[ramsey/uuid-doctrine

Use ramsey/uuid as a Doctrine field type.

90340.3M211](/packages/ramsey-uuid-doctrine)[reliese/laravel

Reliese Components for Laravel Framework code generation.

1.7k3.4M16](/packages/reliese-laravel)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
