walkor / webman-framework

webman-framework
116 stars 57 forks source link

View assigned variables may stay shared between requests #100

Closed latypoff closed 3 months ago

latypoff commented 3 months ago

Here is an example:


<?php

namespace app\controller;

use support\Request;
use support\Response;
use support\View;

class SomeController
{
    public function index(Request $request): Response
    {
        View::assign('username', 'Peter');

               // some logic which throws an exception
        throw new \Exception('some exception');

        // view variable $username still alive and available in next requests
        return view('index');
    }
}
`
walkor commented 3 months ago

Thanks 👍