Stack traces

Stack traces are useful when one is trying to understand the path that has been taken by the code during it’s execution.

To view the current stack trace invoke the global stackTrace(); function from anywhere within your code.

Should you have previously declared your own global function named stackTrace before Strata is executed, Strata’s version will not be injected over the predefined one.

1
2
3
4
5
6
7
8
9
10
11
12
<?php
namespace App\Controller;

use App\Model\Taxonomy\ExpertAdviceType;

class ExpertAdviceTypeController extends AppController
{
    public function index()
    {
        stackTrace();
    }
?>

It will output both in your server logs and right in the html :

Stack trace output