No Debug Toolbar on Yii Advanced Template

Hi, I installed Yii 2.0.0 application using composer and I have a problem with missing toolbar.

my composer.json




{

    "name": "yiisoft/yii2-app-advanced",

    "description": "Yii 2 Advanced Application Template",

    "keywords": ["yii2", "framework", "advanced", "application template"],

    "homepage": "http://www.yiiframework.com/",

    "type": "project",

    "license": "BSD-3-Clause",

    "support": {

        "issues": "https://github.com/yiisoft/yii2/issues?state=open",

        "forum": "http://www.yiiframework.com/forum/",

        "wiki": "http://www.yiiframework.com/wiki/",

        "irc": "irc://irc.freenode.net/yii",

        "source": "https://github.com/yiisoft/yii2"

    },

    "minimum-stability": "stable",

    "require": {

        "php": ">=5.4.0",

        "yiisoft/yii2": "*",

        "yiisoft/yii2-bootstrap": "*",

        "yiisoft/yii2-swiftmailer": "*",

        "yiisoft/yii2-gii": "*",

        "yiisoft/yii2-smarty": "*"

    },

    "require-dev": {

        "yiisoft/yii2-codeception": "*",

        "yiisoft/yii2-debug": "*",

        "yiisoft/yii2-gii": "*",

        "yiisoft/yii2-faker": "*"

    },

    "config": {

        "process-timeout": 1800

    },

    "extra": {

        "asset-installer-paths": {

            "npm-asset-library": "vendor/npm",

            "bower-asset-library": "vendor/bower"

        }

    }

}



My frontend/config/main.php


<?php

$params = array_merge(

    require(__DIR__ . '/../../common/config/params.php'),

    require(__DIR__ . '/../../common/config/params-local.php'),

    require(__DIR__ . '/params.php'),

    require(__DIR__ . '/params-local.php')

);


return [

    'id' => 'app-frontend',

    'basePath' => dirname(__DIR__),

    'bootstrap' => ['debug'],

    'modules' => [

        'debug' => [

            'class' => 'yii\debug\Module',

            'allowedIPs' => ['*']

        ]

    ],

    'controllerNamespace' => 'frontend\controllers',

    'components' => [

        'user' => [

            'identityClass' => 'common\models\User',

            'enableAutoLogin' => true,

        ],

        'log' => [

            'traceLevel' => YII_DEBUG ? 3 : 0,

            'targets' => [

                [

                    'class' => 'yii\log\FileTarget',

                    'levels' => ['error', 'warning'],

                ],

            ],

        ],

        'errorHandler' => [

            'errorAction' => 'site/error',

        ],

    ],

    'params' => $params,

];

Of course I’m using development environment (I set it up during init).

I ran "composer update" in the project directory.

So everthing is done by the book but the is no toolbar at the bottom of the default front page. I know the release is quite fresh and there might be bugs but I’ve seen it working on some youtube video.

Can you help me with it? There are no errors in Firebug console or any othe Firebug tab.

Do you have it in the basic app?

Unfortunately I don’t have it. No error either, php error_reporting on both sites is enabled

I guess that your local IP is not 127.0.0.1 so you need to adjust it like it’s mentioned in the guide:

http://www.yiiframework.com/doc-2.0/guide-tool-gii.html

got it working :)

I had to change main-local.php which no guide mentions




if (YII_ENV_DEV) {

    // configuration adjustments for 'dev' environment

    $config['bootstrap'][] = 'debug';

    $config['modules']['debug']['class'] = 'yii\debug\Module';

    $config['modules']['debug']['allowedIPs'] = ['*'];


    $config['bootstrap'][] = 'gii';

    $config['modules']['gii']['class'] = 'yii\gii\Module';

    $config['modules']['gii']['allowedIPs'] = ['*'];

}



1 Like

The code worked for me(yii 2.0.8) after adding a exclamation mark(!) before YII_ENV_DEV inside if part::




if (!YII_ENV_TEST) {

    // configuration adjustments for 'dev' environment

    $config['bootstrap'][] = 'debug';

    $config['modules']['debug'] = [

        'class' => 'yii\debug\Module',

    ];

    $config['modules']['debug']['allowedIPs'] = ['*'];


    $config['bootstrap'][] = 'gii';

    $config['modules']['gii'] = [

        'class' => 'yii\gii\Module',

    ];

    $config['modules']['gii']['allowedIPs'] = ['*'];


}