PHPackages                             pastuhov/yii2-query-tag - 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. [Testing &amp; Quality](/categories/testing)
4. /
5. pastuhov/yii2-query-tag

ActiveYii2-extension[Testing &amp; Quality](/categories/testing)

pastuhov/yii2-query-tag
=======================

Query tag extension for Yii 2

1.2.0(8y ago)36.3k↑68.8%MITPHP

Since Aug 7Pushed 8y ago2 watchersCompare

[ Source](https://github.com/pastuhov/yii2-query-tag)[ Packagist](https://packagist.org/packages/pastuhov/yii2-query-tag)[ RSS](/packages/pastuhov-yii2-query-tag/feed)WikiDiscussions master Synced today

READMEChangelog (4)Dependencies (6)Versions (8)Used By (0)

[![Build Status](https://camo.githubusercontent.com/2622495bf3185d5c781bccafa4b02d05b1099c745de790aa3a69783c012ac2d5/68747470733a2f2f7472617669732d63692e6f72672f7061737475686f762f796969322d71756572792d7461672e737667)](https://travis-ci.org/pastuhov/yii2-query-tag)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/e1463d0c5ab1c2f105e52e981df7f451778060eb2d619320930fba80419d2049/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7061737475686f762f796969322d71756572792d7461672f6261646765732f7175616c6974792d73636f72652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/pastuhov/yii2-query-tag/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/6c4e343a0121e79f64c37aac5d40a41517ee2e790c0c604dd39723e6176dacf8/68747470733a2f2f7363727574696e697a65722d63692e636f6d2f672f7061737475686f762f796969322d71756572792d7461672f6261646765732f636f7665726167652e706e673f623d6d6173746572)](https://scrutinizer-ci.com/g/pastuhov/yii2-query-tag/?branch=master)[![Total Downloads](https://camo.githubusercontent.com/7a2161fc5d72cc5573a0969db59d07af40a43eee148f02db439ecad248122240/68747470733a2f2f706f7365722e707567782e6f72672f7061737475686f762f796969322d71756572792d7461672f646f776e6c6f616473)](https://packagist.org/packages/pastuhov/yii2-query-tag)

Query tag extension for Yii 2
=============================

[](#query-tag-extension-for-yii-2)

Do you use `pgbabger` or `pg_stat_statements` ? And sometimes it can be difficult to understand which code generates the request? `yii2-query-tag` will help!

Before:

```
SELECT * FROM page WHERE 1=1
```

After:

```
SELECT /* ExampleTest:11 UnitHelper:28 Step:218 */ * FROM page WHERE 1=1
```

Features
--------

[](#features)

- Production ready/safe/tested
- Saves team time

Installation
------------

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist pastuhov/yii2-query-tag

```

or add

```
"require-dev": {
    "pastuhov/yii2-query-tag": "~1.1.0"
    ...

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

Change your app config:

```
    'components' => [
        'db' => [
            'class' => \yii\db\Connection::class,
            'commandClass' => \pastuhov\querytag\Command::class, //
