bedezign\yii2\audit\models\AuditTrail::getDiffHtml PHP Method

getDiffHtml() public method

public getDiffHtml ( ) : mixed
return mixed
    public function getDiffHtml()
    {
        $old = explode("\n", $this->old_value);
        $new = explode("\n", $this->new_value);
        foreach ($old as $i => $line) {
            $old[$i] = rtrim($line, "\r\n");
        }
        foreach ($new as $i => $line) {
            $new[$i] = rtrim($line, "\r\n");
        }
        $diff = new \Diff($old, $new);
        return $diff->render(new \Diff_Renderer_Html_Inline());
    }