小编fos*_*455的帖子

如何在 Yii2 中启用调试模式?

我有基础版本。我阅读了文章http://www.yiiframework.com/doc-2.0/yii-debug-module.html但我不明白在哪个文件中插入代码,其中包括调试?

查了一下资料,发现在 config/web.php 里面的 debug 在 YII_ENV_DEV 部分是这样写的:

if (YII_ENV_DEV) {
    // configuration adjustments for 'dev' environment
    $config['bootstrap'][] = 'debug';
    $config['modules']['debug'] = [
        'class' => 'yii\debug\Module',
        // uncomment the following to add your IP if you are not connecting from localhost.
        'allowedIPs' => ['85.89.139.124'],
    ];

    $config['bootstrap'][] = 'gii';
    $config['modules']['gii'] = [
        'class' => 'yii\gii\Module',
        // uncomment the following to add your IP if you are not connecting from localhost.
        //'allowedIPs' => ['127.0.0.1', '::1'],
    ];
}
Run Code Online (Sandbox Code Playgroud)

应用程序/网络/index.php

 <?php
       defined('YII_DEBUG') …
Run Code Online (Sandbox Code Playgroud)

yii2

6
推荐指数
1
解决办法
2万
查看次数

为什么自动上传在 PhpStorm 中不起作用?

我配置了FTP服务器配置,但我无法启用自动上传

在此处输入图片说明

在此处输入图片说明

Weberver 是一个简单的 LAMP Debian Jessie。怎么了?我该做什么?

phpstorm

4
推荐指数
1
解决办法
2191
查看次数

为什么Yii2的try / catch失败了?

我插入一个条目,其中有主键的重复项。

public function actionInc()
{
        $add = new Country();
        $add->code = 'QI';
        $add->name = 'Qiang';
        $add->population = '4444444';
    try {
        $add->save();
        return $this->render('inc', [
            'count' => 'Ok',
        ]);
    } catch (Exception $exception) {
        return $this->render('inc', [
            'count' => 'Error',
        ]);
    }
}
Run Code Online (Sandbox Code Playgroud)

但我需要该应用程序不关闭,并继续工作,但不起作用... 屏幕截图

php yii2

3
推荐指数
1
解决办法
5323
查看次数

标签 统计

yii2 ×2

php ×1

phpstorm ×1