Yii2 does not show error line number in layout file

Hi all,

If the error occurs in view file (such as /site/index.php).

Yii2 shows the error line perfect. But when the error occurs in the layout file (such as /layouts/main.php.

Yii2 only points to the function render in controller/action, such as:


$this->render('index', [

   'user' => $user

]);

Please help me.

Hi, for anyone who get the problem like me:

I solve this problem by correct character unicode of source code file.

  • Create new file with utf-8 character code.

  • Copy source code from old file to new file.

  • Delete old file, rename new file with old file’s name.