Disable notice yii
13,435
Update public/index.php
<?php
define('YII_ENABLE_ERROR_HANDLER', false);
define('YII_ENABLE_EXCEPTION_HANDLER', false);
// Turn off all error reporting
// error_reporting(0);
// Report all errors except E_NOTICE
// This is the default value set in php.ini
error_reporting(E_ALL ^ E_NOTICE);
Author by
user2420249
Updated on June 14, 2022Comments
-
user2420249 almost 2 years
How disable notice , i try in idex.php But Notice is echo , how i can disable this .
<? define("YII_ENBLE_ERROR_HANDLER",false) define("YII_ENBLE_EXCEPTION_HANDLER",false) ?>
in php.ini
<?display_errors = off ?>
-
Valery Viktorovsky almost 11 yearsAdd define('YII_ENABLE_ERROR_HANDLER', false) to index.php and then set error reporting.
-
user2420249 almost 11 yearsNotice: Undefined property: stdClass::$edited in E:\web\domains\cabinet\protected\views\timeshares\index.php on line 34
-
Valery Viktorovsky almost 11 yearsYou should disable YII_ENABLE_ERROR_HANDLER in public/index.php, not in app/views/timeshares/index.php
-
user2420249 almost 11 yearsthis is my index.php <?php // change the following paths if necessary $yii=dirname(FILE).'/framework/yii.php'; $config=dirname(FILE).'/protected/config/main.php'; defined('YII_DEBUG') or define('YII_DEBUG',false); // specify how many levels of call stack should be shown in each log message defined('YII_TRACE_LEVEL') or define('YII_TRACE_LEVEL',3); define('YII_ENABLE_ERROR_HANDLER',false); define('YII_ENABLE_EXCEPTION_HANDLER',false); error_reporting(0); error_reporting(E_ALL ^ E_NOTICE); require_once($yii); Yii::createWebApplication($config)->run();
-
Admin almost 11 yearsThere is a type in your answer, cant edit because one character:
YII_ENBLE_EXCEPTION_HANDLER
should beYII_ENABLE_EXCEPTION_HANDLER
- same typo is in question