Analyzing the Yii error stack trace
When an error occurs, Yii can display the error stack trace along with the error. A stack trace is especially helpful when we need to know what really caused an error rather than just the fact that an error occurred.
Getting ready
- Create a new
yii2-app-basic
application by using the Composer package manager, as described in the official guide at http://www.yiiframework.com/doc-2.0/guide-start-installation.html. - Configure a database and import the following migration:
<?php use yii\db\Migration; class m160308_093234_create_article_table extends Migration { public function up() { $this->createTable('{{%article}}', [ 'id' => $this->primaryKey(), 'alias' => $this->string()->notNull(), 'title' => $this->string()->notNull(), 'text' => $this->text()->notNull(), ]); } public function down() ...